|
@@ -460,8 +460,10 @@ void Stepper::isr() {
|
460
|
460
|
_APPLY_STEP(AXIS)(_INVERT_STEP_PIN(AXIS),0); \
|
461
|
461
|
}
|
462
|
462
|
|
|
463
|
+ #define CYCLES_EATEN_BY_CODE 240
|
|
464
|
+
|
463
|
465
|
// If a minimum pulse time was specified get the CPU clock
|
464
|
|
- #if MINIMUM_STEPPER_PULSE > 0
|
|
466
|
+ #if STEP_PULSE_CYCLES > CYCLES_EATEN_BY_CODE
|
465
|
467
|
static uint32_t pulse_start;
|
466
|
468
|
pulse_start = TCNT0;
|
467
|
469
|
#endif
|
|
@@ -494,9 +496,8 @@ void Stepper::isr() {
|
494
|
496
|
#endif // !ADVANCE && !LIN_ADVANCE
|
495
|
497
|
|
496
|
498
|
// For a minimum pulse time wait before stopping pulses
|
497
|
|
- #if MINIMUM_STEPPER_PULSE > 0
|
498
|
|
- #define CYCLES_EATEN_BY_CODE 10
|
499
|
|
- while ((uint32_t)(TCNT0 - pulse_start) < (MINIMUM_STEPPER_PULSE * (F_CPU / 1000000UL)) - CYCLES_EATEN_BY_CODE) { /* nada */ }
|
|
499
|
+ #if STEP_PULSE_CYCLES > CYCLES_EATEN_BY_CODE
|
|
500
|
+ while ((uint32_t)(TCNT0 - pulse_start) < STEP_PULSE_CYCLES - CYCLES_EATEN_BY_CODE) { /* nada */ }
|
500
|
501
|
#endif
|
501
|
502
|
|
502
|
503
|
#if HAS_X_STEP
|
|
@@ -688,10 +689,12 @@ void Stepper::isr() {
|
688
|
689
|
E## INDEX ##_STEP_WRITE(INVERT_E_STEP_PIN); \
|
689
|
690
|
}
|
690
|
691
|
|
|
692
|
+ #define CYCLES_EATEN_BY_E 60
|
|
693
|
+
|
691
|
694
|
// Step all E steppers that have steps
|
692
|
695
|
for (uint8_t i = 0; i < step_loops; i++) {
|
693
|
696
|
|
694
|
|
- #if MINIMUM_STEPPER_PULSE > 0
|
|
697
|
+ #if STEP_PULSE_CYCLES > CYCLES_EATEN_BY_E
|
695
|
698
|
static uint32_t pulse_start;
|
696
|
699
|
pulse_start = TCNT0;
|
697
|
700
|
#endif
|
|
@@ -708,9 +711,8 @@ void Stepper::isr() {
|
708
|
711
|
#endif
|
709
|
712
|
|
710
|
713
|
// For a minimum pulse time wait before stopping pulses
|
711
|
|
- #if MINIMUM_STEPPER_PULSE > 0
|
712
|
|
- #define CYCLES_EATEN_BY_E 10
|
713
|
|
- while ((uint32_t)(TCNT0 - pulse_start) < (MINIMUM_STEPPER_PULSE * (F_CPU / 1000000UL)) - CYCLES_EATEN_BY_E) { /* nada */ }
|
|
714
|
+ #if STEP_PULSE_CYCLES > CYCLES_EATEN_BY_E
|
|
715
|
+ while ((uint32_t)(TCNT0 - pulse_start) < STEP_PULSE_CYCLES - CYCLES_EATEN_BY_E) { /* nada */ }
|
714
|
716
|
#endif
|
715
|
717
|
|
716
|
718
|
STOP_E_PULSE(0);
|