From: Arthur Wolf Date: Wed, 20 Feb 2013 23:12:01 +0000 (+0100) Subject: cleaning up debug gpios X-Git-Url: https://git.hcoop.net/clinton/Smoothieware.git/commitdiff_plain/538addb95238a97b47cb787fcb1050912fd1c42a cleaning up debug gpios --- diff --git a/src/libs/StepTicker.cpp b/src/libs/StepTicker.cpp index 5df12aaf..cd457a41 100644 --- a/src/libs/StepTicker.cpp +++ b/src/libs/StepTicker.cpp @@ -131,16 +131,10 @@ extern "C" void TIMER1_IRQHandler (void){ // The actual interrupt handler where we do all the work extern "C" void TIMER0_IRQHandler (void){ - LPC_GPIO1->FIODIR |= 1<<22; - LPC_GPIO1->FIOSET = 1<<22; - -// uint32_t initial_tc = LPC_TIM0->TC; - LPC_TIM0->IR |= 1 << 0; // If no axes enabled, just ignore for now if( global_step_ticker->active_motor_bm == 0 ){ - LPC_GPIO1->FIOCLR = 1<<22; return; } @@ -175,9 +169,6 @@ extern "C" void TIMER0_IRQHandler (void){ // This can be OK, if we take notice of it, which we do now if( LPC_TIM0->TC > global_step_ticker->period ){ // TODO: remove the size condition - LPC_GPIO1->FIODIR |= 1<<23; - LPC_GPIO1->FIOSET = 1<<23; - uint32_t start_tc = LPC_TIM0->TC; // How many ticks we want to skip ( this does not include the current tick, but we add the time we spent doing this computation last time ) @@ -214,8 +205,6 @@ extern "C" void TIMER0_IRQHandler (void){ //if( global_step_ticker->last_duration > 2000 || LPC_TIM0->MR0 > 2000 || LPC_TIM0->TC > 2000 || initial_tc > 2000 ){ __debugbreak(); } - LPC_GPIO1->FIOCLR = 1<<23; - }else{ LPC_TIM0->MR0 = global_step_ticker->period; } @@ -224,7 +213,6 @@ extern "C" void TIMER0_IRQHandler (void){ LPC_TIM0->MR0 += global_step_ticker->period; } - LPC_GPIO1->FIOCLR = 1<<22; } diff --git a/src/libs/StepperMotor.cpp b/src/libs/StepperMotor.cpp index d0fdc584..a20b1d53 100644 --- a/src/libs/StepperMotor.cpp +++ b/src/libs/StepperMotor.cpp @@ -42,18 +42,12 @@ StepperMotor::StepperMotor(Pin* step, Pin* dir, Pin* en) : step_pin(step), dir_p // Called a great many times per second, to step if we have to now void StepperMotor::tick(){ - LPC_GPIO1->FIODIR |= 1<<31; - LPC_GPIO1->FIOSET = 1<<31; - // increase the ( fixed point ) counter by one tick 11t this->fx_counter += (uint64_t)((uint64_t)1<<32); // if we are to step now 10t if( this->fx_counter >= this->fx_ticks_per_step ){ - LPC_GPIO1->FIODIR |= 1<<30; - LPC_GPIO1->FIOSET = 1<<30; - // output to pins 37t this->step_pin->set( 1 ); this->step_ticker->reset_step_pins = true; @@ -75,12 +69,8 @@ void StepperMotor::tick(){ this->step_ticker->moves_finished = true; } - LPC_GPIO1->FIOCLR = 1<<30; - } - LPC_GPIO1->FIOCLR = 1<<31; - } // If the move is finished, the StepTicker will call this ( because we asked it to in tick() ) @@ -146,15 +136,6 @@ void StepperMotor::move( bool direction, unsigned int steps ){ // Set the speed at which this steper moves void StepperMotor::set_speed( double speed ){ -// if( speed <= 1.0 ){ -// this->steps_per_second = 0; -// this->fx_ticks_per_step = 1ULL<<63; -// return; -// } - - //if( speed < this->steps_per_second ){ - LPC_GPIO1->FIOSET = 1<<19; - //} if (speed < 1.0) speed = 1.0;