#include "libs/Pin.h"
// This is an interface to the mbed.org ADC library you can find in libs/ADC/adc.h
-// TODO : Having the same name is confusing, should change that
+// TODO : Having the same name is confusing, should change that
Adc::Adc(){
this->adc = new ADC(1000, 1);
#define baud_rate_setting_checksum CHECKSUM("baud_rate")
#define uart0_checksum CHECKSUM("uart0")
-// This is used to configure UARTs depending on the MRI configuration, see Kernel::Kernel()
+// This is used to configure UARTs depending on the MRI configuration, see Kernel::Kernel()
static int isDebugMonitorUsingUart0(){
return NVIC_GetPriority(UART0_IRQn) == 0;
}
this->streams = new StreamOutputPool();
// Configure UART depending on MRI config
- // If MRI is using UART0, we want to use UART1, otherwise, we want to use UART0. This makes it easy to use only one UART for both debug and actual commands.
+ // If MRI is using UART0, we want to use UART1, otherwise, we want to use UART0. This makes it easy to use only one UART for both debug and actual commands.
NVIC_SetPriorityGrouping(0);
if( !isDebugMonitorUsingUart0() ){
this->serial = new SerialConsole(USBTX, USBRX, this->config->value(uart0_checksum,baud_rate_setting_checksum)->by_default(9600)->as_number());
this->step_ticker = new StepTicker();
this->adc = new Adc();
- // TODO : These should go into platform-specific files
+ // TODO : These should go into platform-specific files
// LPC17xx-specific
NVIC_SetPriorityGrouping(0);
NVIC_SetPriority(TIMER0_IRQn, 2);
int base_stepping_frequency = this->config->value(base_stepping_frequency_checksum )->by_default(100000)->as_number();
double microseconds_per_step_pulse = this->config->value(microseconds_per_step_pulse_checksum )->by_default(5 )->as_number();
- // Configure the step ticker ( TODO : shouldnt this go into stepticker's code ? )
+ // Configure the step ticker ( TODO : shouldnt this go into stepticker's code ? )
this->step_ticker->set_reset_delay( microseconds_per_step_pulse / 1000000L );
this->step_ticker->set_frequency( base_stepping_frequency );
#include <sLPC17xx.h>
#include <mri.h>
-// This is used by MRI to turn pins on and off when entering and leaving MRI. Useful for not burning everything down
+// This is used by MRI to turn pins on and off when entering and leaving MRI. Useful for not burning everything down
// See http://smoothieware.org/mri-debugging
extern "C" {
// The Pauser module is the core of the pausing subsystem in smoothie. Basically we want several modules to be able to pause smoothie at the same time
// ( think both the user with a button, and the temperature control because a temperature is not reached ). To do that, modules call the take() methode,
// a pause event is called, and the pause does not end before all modules have called the release() method.
-// Please note : Modules should keep track of their pause status themselves
+// Please note : Modules should keep track of their pause status themselves
Pauser::Pauser(){}
void Pauser::on_module_loaded(){
}
// Make a new pin object from a string
-// TODO : Comment this more, how does it work ?
Pin* Pin::from_string(std::string value){
LPC_GPIO_TypeDef* gpios[5] ={LPC_GPIO0,LPC_GPIO1,LPC_GPIO2,LPC_GPIO3,LPC_GPIO4};
// ISP button
ispbtn.from_string("2.10")->as_input()->pull_up();
- // TODO: What is this ??
+ // TODO: What is this ??
flag_1s_flag = 0;
flag_1s_count = SystemCoreClock;
g4_ticks = 0;
}
- // Enter MRI mode if the ISP button is pressed
- // TODO : This should have it's own module
+ // Enter MRI mode if the ISP button is pressed
+ // TODO: This should have it's own module
if (ispbtn.get() == 0)
__debugbreak();
global_step_ticker->reset_step_pins = false;
}else{
// Nothing happened, nothing after this really matters
- // TODO : This could be a problem when we use Actuators instead of StepperMotors, because this flag is specific to step generation
+ // TODO : This could be a problem when we use Actuators instead of StepperMotors, because this flag is specific to step generation
LPC_TIM0->MR0 = global_step_ticker->period;
return;
}
#include "StepperMotor.h"
#include "MRI_Hooks.h"
-// A StepperMotor represents an actual stepper motor. It is used to generate steps that move the actual motor at a given speed
-// TODO : Abstract this into Actuator
+// A StepperMotor represents an actual stepper motor. It is used to generate steps that move the actual motor at a given speed
+// TODO : Abstract this into Actuator
StepperMotor::StepperMotor(){
this->moving = false;
// How many ticks ( base steps ) between each actual step at this speed, in fixed point 64
double ticks_per_step = (double)( (double)this->step_ticker->frequency / speed );
- double double_fx_ticks_per_step = (double)(1<<8) * ( (double)(1<<8) * ticks_per_step ); // 8x8 because we had to do 16x16 because 32 did not work
+ double double_fx_ticks_per_step = (double)(1<<8) * ( (double)(1<<8) * ticks_per_step ); // 8x8 because we had to do 16x16 because 32 did not work
this->fx_ticks_per_step = (uint32_t)( floor(double_fx_ticks_per_step) );
}
#include <mri.h>
-// TODO : comment this
-// Basically, when stuff stop answering, reset, or enter MRI mode, or something
+// TODO : comment this
+// Basically, when stuff stop answering, reset, or enter MRI mode, or something
Watchdog::Watchdog(uint32_t timeout, WDT_ACTION action)
{
// Watchdog wd(5000000, WDT_MRI);
-// USB Stuff
+// USB Stuff
SDCard sd(P0_9, P0_8, P0_7, P0_6); // this selects SPI1 as the sdcard as it is on Smoothieboard
//SDCard sd(P0_18, P0_17, P0_15, P0_16); // this selects SPI0 as the sdcard
// This is one of the craziest bits in smoothie
void Block::release(){
- // A block can be taken by several modules, we want to actually release it only when all modules have release()d it
+ // A block can be taken by several modules, we want to actually release it only when all modules have release()d it
this->times_taken--;
if( this->times_taken < 1 ){
// The stepper reacts to blocks that have XYZ movement to transform them into actual stepper motor moves
-// TODO: This does accel, accel should be in StepperMotor
+// TODO: This does accel, accel should be in StepperMotor
Stepper* stepper;
uint32_t previous_step_count;