diff --git a/Firmware/stepper.cpp b/Firmware/stepper.cpp index b9d15126..1283675c 100644 --- a/Firmware/stepper.cpp +++ b/Firmware/stepper.cpp @@ -785,7 +785,7 @@ FORCE_INLINE void isr() { #ifdef LIN_ADVANCE - WRITE_NC(E0_DIR_PIN, e_steps < 0? INVERT_E0_DIR: !INVERT_E0_DIR); + if (e_steps) WRITE_NC(E0_DIR_PIN, e_steps < 0? INVERT_E0_DIR: !INVERT_E0_DIR); uint8_t la_state = 0; #endif @@ -898,7 +898,7 @@ FORCE_INLINE void advance_isr() { if (step_events_completed.wide > LA_decelerate_after && current_adv_steps > final_adv_steps) { // decompression e_steps -= e_step_loops; - WRITE_NC(E0_DIR_PIN, e_steps < 0? INVERT_E0_DIR: !INVERT_E0_DIR); + if (e_steps) WRITE_NC(E0_DIR_PIN, e_steps < 0? INVERT_E0_DIR: !INVERT_E0_DIR); if(current_adv_steps > e_step_loops) current_adv_steps -= e_step_loops; else @@ -908,7 +908,7 @@ FORCE_INLINE void advance_isr() { else if (step_events_completed.wide < LA_decelerate_after && current_adv_steps < max_adv_steps) { // compression e_steps += e_step_loops; - WRITE_NC(E0_DIR_PIN, e_steps < 0? INVERT_E0_DIR: !INVERT_E0_DIR); + if (e_steps) WRITE_NC(E0_DIR_PIN, e_steps < 0? INVERT_E0_DIR: !INVERT_E0_DIR); current_adv_steps += e_step_loops; nextAdvanceISR = eISR_Rate; }