Sfoglia il codice sorgente

Initialize current_adv_steps correctly

Initialize at 0 both on startup and on reset on regular (non-LA)
segments to avoid cumulating errors.
Yuri D'Elia 5 anni fa
parent
commit
a1be8b6784
1 ha cambiato i file con 2 aggiunte e 0 eliminazioni
  1. 2 0
      Firmware/stepper.cpp

+ 2 - 0
Firmware/stepper.cpp

@@ -361,6 +361,7 @@ FORCE_INLINE void stepper_next_block()
         eISR_Rate = ADV_NEVER;
         e_step_loops = 1;
         LA_phase = -1;
+        current_adv_steps = 0;
     }
 #endif
 
@@ -1165,6 +1166,7 @@ void st_init()
   e_steps = 0;
   e_step_loops = 1;
   LA_phase = -1;
+  current_adv_steps = 0;
 #endif
 
   enable_endstops(true); // Start with endstops active. After homing they can be disabled