bool recalculate_flag :1; // Planner flag to recalculate trapezoids on entry junction
bool nominal_length_flag :1; // Planner flag for nominal speed always reached
bool is_ready :1;
- bool finish_early :1; // assert if we want the block to end NOW rather than finish all steps
};
};
};
return 0;
}
+ if (THEKERNEL->conveyor->flush)
+ {
+ if (trapezoid_adjusted_rate > current_block->rate_delta * 1.5F)
+ {
+ trapezoid_adjusted_rate -= current_block->rate_delta;
+ }
+ else if (trapezoid_adjusted_rate == 0.0F)
+ {
+ for (auto i = THEKERNEL->robot->actuators.begin(); i != THEKERNEL->robot->actuators.end(); i++)
+ (*i)->move(0, 0);
+
+ if (current_block)
+ current_block->release();
+
+ return 0;
+ }
+ else
+ {
+ trapezoid_adjusted_rate = current_block->rate_delta * 0.5F;
+ }
+ set_step_events_per_second(trapezoid_adjusted_rate);
+ }
// If we are accelerating
- if (current_steps_completed <= current_block->accelerate_until + 1)
+ else if (current_steps_completed <= current_block->accelerate_until + 1)
{
// Increase speed
trapezoid_adjusted_rate += current_block->rate_delta;
set_step_events_per_second(trapezoid_adjusted_rate);
}
// If we are decelerating
- else if (current_block->finish_early || (current_steps_completed > current_block->decelerate_after))
+ else if (current_steps_completed > current_block->decelerate_after)
{
// Reduce speed
// NOTE: We will only reduce speed if the result will be > 0. This catches small