bugfix: uninitiallized curr_block->new_entry_speed_sqr lead to step loss
in some cases
This commit is contained in:
parent
74bdc32332
commit
a0f430d188
@ -257,7 +257,7 @@ static uint8_t planner_recalculate()
|
||||
// If entry speed is already at the maximum entry speed, no need to recheck. Block is cruising.
|
||||
// If not, block in state of acceleration or deceleration. Reset entry speed to maximum and
|
||||
// check for maximum allowable speed reductions to ensure maximum possible planned speed.
|
||||
if (curr_block->entry_speed_sqr != curr_block->max_entry_speed_sqr) {
|
||||
if (curr_block->entry_speed_sqr >= curr_block->max_entry_speed_sqr) {
|
||||
// default if next_entry_speed_sqr > curr_block->max_entry_speed_sqr || max_entry_speed_sqr > curr_block->max_entry_speed_sqr
|
||||
curr_block->new_entry_speed_sqr = curr_block->max_entry_speed_sqr;
|
||||
|
||||
@ -268,6 +268,8 @@ static uint8_t planner_recalculate()
|
||||
curr_block->new_entry_speed_sqr = max_entry_speed_sqr;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
curr_block->new_entry_speed_sqr = curr_block->entry_speed_sqr;
|
||||
}
|
||||
next_entry_speed_sqr= curr_block->new_entry_speed_sqr;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user