// Step pins NOTE takes 1.2us when nothing to step, 1.8-2us for one motor stepped and 2.6us when two motors stepped, 3.167us when three motors stepped
for (uint32_t motor = 0; motor < num_motors; motor++){
- if (this->active_motor[motor]){
- this->motor[motor]->tick();
- }
+ // always send tick to all motors
+ this->motor[motor]->tick();
}
// We may have set a pin on in this tick, now we start the timer to set it off
this->stepped = 0;
this->steps_to_move = 0;
this->is_move_finished = false;
+ this->active= false;
steps_per_mm = 1.0F;
max_rate = 50.0F;
void StepperMotor::step()
{
// we can't do anything until the next move has been processed, but we will be able to offset the time by shortening the next step
- if(this->is_move_finished || !this->moving) return;
+ if(!this->active) return;
// output to pins 37t
this->step_pin.set( 1 );
if( !this->moving || this->paused || this->steps_to_move == 0 ) {
// No more ticks will be recieved and no more events from StepTicker
THEKERNEL->step_ticker->remove_motor_from_active_list(this);
+ this->active= false;
} else {
// we will now get ticks and StepTIcker will send us events
THEKERNEL->step_ticker->add_motor_to_active_list(this);
+ this->active= true;
}
}