Fork of Smoothie to port to mbed non-LPC targets.
Fork of Smoothie by
Diff: libs/Kernel.cpp
- Revision:
- 3:f151d08d335c
- Parent:
- 2:1df0b61d3b5a
--- a/libs/Kernel.cpp Fri Feb 28 18:52:52 2014 -0800 +++ b/libs/Kernel.cpp Sun Mar 02 06:33:08 2014 +0000 @@ -10,10 +10,8 @@ #include "libs/Config.h" #include "libs/nuts_bolts.h" #include "libs/SlowTicker.h" -#include "libs/Adc.h" #include "libs/Pauser.h" #include "libs/StreamOutputPool.h" -#include <mri.h> #include "modules/communication/SerialConsole.h" #include "modules/communication/GcodeDispatch.h" @@ -22,7 +20,6 @@ #include "modules/robot/Stepper.h" #include "modules/robot/Conveyor.h" #include "modules/tools/endstops/Endstops.h" -#include <malloc.h> #define baud_rate_setting_checksum CHECKSUM("baud_rate") #define uart0_checksum CHECKSUM("uart0") @@ -41,55 +38,13 @@ this->current_path = "/"; - // Configure UART depending on MRI config - // Match up the SerialConsole to MRI UART. This makes it easy to use only one UART for both debug and actual commands. - NVIC_SetPriorityGrouping(0); - switch( __mriPlatform_CommUartIndex() ) { - case 0: - this->serial = new SerialConsole(USBTX, USBRX, this->config->value(uart0_checksum,baud_rate_setting_checksum)->by_default(9600)->as_number()); - break; - case 1: - this->serial = new SerialConsole( p13, p14, this->config->value(uart0_checksum,baud_rate_setting_checksum)->by_default(9600)->as_number()); - break; - case 2: - this->serial = new SerialConsole( p28, p27, this->config->value(uart0_checksum,baud_rate_setting_checksum)->by_default(9600)->as_number()); - break; - case 3: - this->serial = new SerialConsole( p9, p10, this->config->value(uart0_checksum,baud_rate_setting_checksum)->by_default(9600)->as_number()); - break; - } - this->add_module( this->config ); this->add_module( this->serial ); // HAL stuff add_module( this->slow_ticker = new SlowTicker()); this->step_ticker = new StepTicker(); - this->adc = new Adc(); - - // TODO : These should go into platform-specific files - // LPC17xx-specific - NVIC_SetPriorityGrouping(0); - NVIC_SetPriority(TIMER0_IRQn, 2); - NVIC_SetPriority(TIMER1_IRQn, 1); - NVIC_SetPriority(TIMER2_IRQn, 3); - - // Set other priorities lower than the timers - NVIC_SetPriority(ADC_IRQn, 4); - NVIC_SetPriority(USB_IRQn, 4); - - // If MRI is enabled - if( MRI_ENABLE ){ - if( NVIC_GetPriority(UART0_IRQn) > 0 ){ NVIC_SetPriority(UART0_IRQn, 4); } - if( NVIC_GetPriority(UART1_IRQn) > 0 ){ NVIC_SetPriority(UART1_IRQn, 4); } - if( NVIC_GetPriority(UART2_IRQn) > 0 ){ NVIC_SetPriority(UART2_IRQn, 4); } - if( NVIC_GetPriority(UART3_IRQn) > 0 ){ NVIC_SetPriority(UART3_IRQn, 4); } - }else{ - NVIC_SetPriority(UART0_IRQn, 4); - NVIC_SetPriority(UART1_IRQn, 4); - NVIC_SetPriority(UART2_IRQn, 4); - NVIC_SetPriority(UART3_IRQn, 4); - } +// this->adc = new Adc(); // Configure the step ticker int base_stepping_frequency = this->config->value(base_stepping_frequency_checksum )->by_default(100000)->as_number();