Planner anti-stutter by Sebastian Popp
This commit is contained in:
@ -534,6 +534,16 @@ class Planner {
|
||||
static block_t* get_current_block() {
|
||||
if (blocks_queued()) {
|
||||
block_t * const block = &block_buffer[block_buffer_tail];
|
||||
|
||||
// If the block has no trapezoid calculated, it's unsafe to execute.
|
||||
if (movesplanned() > 1) {
|
||||
const block_t * const next = &block_buffer[next_block_index(block_buffer_tail)];
|
||||
if (TEST(block->flag, BLOCK_BIT_RECALCULATE) || TEST(next->flag, BLOCK_BIT_RECALCULATE))
|
||||
return NULL;
|
||||
}
|
||||
else if (TEST(block->flag, BLOCK_BIT_RECALCULATE))
|
||||
return NULL;
|
||||
|
||||
#if ENABLED(ULTRA_LCD)
|
||||
block_buffer_runtime_us -= block->segment_time_us; // We can't be sure how long an active block will take, so don't count it.
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user