diff --git a/Marlin/stepper.cpp b/Marlin/stepper.cpp index a604c92716..51459602f0 100644 --- a/Marlin/stepper.cpp +++ b/Marlin/stepper.cpp @@ -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);