Apply MINIMUM_STEPPER_PULSE in stepper advance_isr

master
Scott Lahteine 8 years ago
parent 8c7ee4599e
commit 426f662586

@ -709,6 +709,11 @@ void Stepper::isr() {
// Step all E steppers that have steps
for (uint8_t i = 0; i < step_loops; i++) {
#if MINIMUM_STEPPER_PULSE > 0
static uint32_t pulse_start;
pulse_start = TCNT0;
#endif
START_E_PULSE(0);
#if E_STEPPERS > 1
START_E_PULSE(1);
@ -720,6 +725,12 @@ void Stepper::isr() {
#endif
#endif
// For a minimum pulse time wait before stopping pulses
#if MINIMUM_STEPPER_PULSE > 0
#define CYCLES_EATEN_BY_E 10
while ((uint32_t)(TCNT0 - pulse_start) < (MINIMUM_STEPPER_PULSE * (F_CPU / 1000000UL)) - CYCLES_EATEN_BY_E) { /* nada */ }
#endif
STOP_E_PULSE(0);
#if E_STEPPERS > 1
STOP_E_PULSE(1);

Loading…
Cancel
Save