From 1f11b0f612ffc1087df6a46c422fcef4f2b1eb86 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 6 May 2018 04:21:33 -0500 Subject: [PATCH] Fully init planner sync block --- Marlin/src/module/planner.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/Marlin/src/module/planner.cpp b/Marlin/src/module/planner.cpp index 4be4b2af5..9eac9e261 100644 --- a/Marlin/src/module/planner.cpp +++ b/Marlin/src/module/planner.cpp @@ -2035,12 +2035,29 @@ void Planner::buffer_sync_block() { uint8_t next_buffer_head; block_t * const block = get_next_free_block(next_buffer_head); + block->flag = BLOCK_FLAG_SYNC_POSITION; + block->steps[A_AXIS] = position[A_AXIS]; block->steps[B_AXIS] = position[B_AXIS]; block->steps[C_AXIS] = position[C_AXIS]; block->steps[E_AXIS] = position[E_AXIS]; - block->flag = BLOCK_FLAG_SYNC_POSITION; + #if ENABLED(LIN_ADVANCE) + block->use_advance_lead = false; + #endif + + block->nominal_speed = + block->entry_speed = + block->max_entry_speed = + block->millimeters = + block->acceleration = 0; + + block->step_event_count = + block->nominal_rate = + block->initial_rate = + block->final_rate = + block->acceleration_steps_per_s2 = + block->segment_time_us = 0; block_buffer_head = next_buffer_head; stepper.wake_up();