#include "libs/Kernel.h"
#include "libs/Module.h"
#include "libs/Config.h"
-#include "mbed.h"
#include "libs/nuts_bolts.h"
#include "libs/SlowTicker.h"
#include "libs/Adc.h"
+#include "libs/Digipot.h"
+#include "libs/Pauser.h"
+#include "libs/StreamOutputPool.h"
#include "modules/communication/SerialConsole.h"
#include "modules/communication/GcodeDispatch.h"
&Module::on_block_end,
&Module::on_config_reload,
&Module::on_play,
- &Module::on_pause
+ &Module::on_pause,
+ &Module::on_idle
};
-#define baud_rate_setting_ckeckusm 10922
+#define baud_rate_setting_checksum 10922
#define uart0_checksum 16877
// The kernel is the central point in Smoothie : it stores modules, and handles event calls
// Config first, because we need the baud_rate setting before we start serial
this->config = new Config();
// Serial second, because the other modules might want to say something
- this->serial = new SerialConsole(USBTX, USBRX, this->config->value(uart0_checksum,baud_rate_setting_ckeckusm)->by_default(9600)->as_number());
+ this->streams = new StreamOutputPool();
+ //this->serial = new SerialConsole(USBTX, USBRX, this->config->value(uart0_checksum,baud_rate_setting_checksum)->by_default(9600)->as_number());
+
this->add_module( this->config );
- this->add_module( this->serial );
-
+ //this->add_module( this->serial );
+
// HAL stuff
this->slow_ticker = new SlowTicker();
- this->slow_ticker->kernel = this; // TODO DEBUG: To remove
this->step_ticker = new StepTicker();
this->adc = new Adc();
+ this->digipot = new Digipot();
// LPC17xx-specific
NVIC_SetPriority(TIMER0_IRQn, 1);
NVIC_SetPriority(TIMER2_IRQn, 2);
// Core modules
- this->gcode_dispatch = new GcodeDispatch();
- this->robot = new Robot();
- this->stepper = new Stepper();
- this->planner = new Planner();
- this->player = new Player();
-
- this->add_module( this->gcode_dispatch );
- this->add_module( this->robot );
- this->add_module( this->stepper );
- this->add_module( this->planner );
- this->add_module( this->player );
-
+ this->add_module( this->gcode_dispatch = new GcodeDispatch() );
+ this->add_module( this->robot = new Robot() );
+ this->add_module( this->stepper = new Stepper() );
+ this->add_module( this->planner = new Planner() );
+ this->add_module( this->player = new Player() );
+ this->add_module( this->pauser = new Pauser() );
}
void Kernel::add_module(Module* module){