Make sure we don't accelerate above the nominal_rate
This commit is contained in:
parent
926d74fcb7
commit
d9a7fc4680
@ -101,6 +101,9 @@ inline void trapezoid_generator_tick() {
|
|||||||
if (current_block) {
|
if (current_block) {
|
||||||
if (step_events_completed < current_block->accelerate_until) {
|
if (step_events_completed < current_block->accelerate_until) {
|
||||||
trapezoid_adjusted_rate += current_block->rate_delta;
|
trapezoid_adjusted_rate += current_block->rate_delta;
|
||||||
|
if (trapezoid_adjusted_rate > current_block->nominal_rate ) {
|
||||||
|
trapezoid_adjusted_rate = current_block->nominal_rate;
|
||||||
|
}
|
||||||
set_step_events_per_minute(trapezoid_adjusted_rate);
|
set_step_events_per_minute(trapezoid_adjusted_rate);
|
||||||
} else if (step_events_completed > current_block->decelerate_after) {
|
} else if (step_events_completed > current_block->decelerate_after) {
|
||||||
// NOTE: We will only reduce speed if the result will be > 0. This catches small
|
// NOTE: We will only reduce speed if the result will be > 0. This catches small
|
||||||
|
Loading…
Reference in New Issue
Block a user