|
|
@ -460,8 +460,10 @@ void Stepper::isr() {
|
|
|
|
_APPLY_STEP(AXIS)(_INVERT_STEP_PIN(AXIS),0); \
|
|
|
|
_APPLY_STEP(AXIS)(_INVERT_STEP_PIN(AXIS),0); \
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define CYCLES_EATEN_BY_CODE 240
|
|
|
|
|
|
|
|
|
|
|
|
// If a minimum pulse time was specified get the CPU clock
|
|
|
|
// If a minimum pulse time was specified get the CPU clock
|
|
|
|
#if MINIMUM_STEPPER_PULSE > 0
|
|
|
|
#if STEP_PULSE_CYCLES > CYCLES_EATEN_BY_CODE
|
|
|
|
static uint32_t pulse_start;
|
|
|
|
static uint32_t pulse_start;
|
|
|
|
pulse_start = TCNT0;
|
|
|
|
pulse_start = TCNT0;
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
@ -494,9 +496,8 @@ void Stepper::isr() {
|
|
|
|
#endif // !ADVANCE && !LIN_ADVANCE
|
|
|
|
#endif // !ADVANCE && !LIN_ADVANCE
|
|
|
|
|
|
|
|
|
|
|
|
// For a minimum pulse time wait before stopping pulses
|
|
|
|
// For a minimum pulse time wait before stopping pulses
|
|
|
|
#if MINIMUM_STEPPER_PULSE > 0
|
|
|
|
#if STEP_PULSE_CYCLES > CYCLES_EATEN_BY_CODE
|
|
|
|
#define CYCLES_EATEN_BY_CODE 10
|
|
|
|
while ((uint32_t)(TCNT0 - pulse_start) < STEP_PULSE_CYCLES - CYCLES_EATEN_BY_CODE) { /* nada */ }
|
|
|
|
while ((uint32_t)(TCNT0 - pulse_start) < (MINIMUM_STEPPER_PULSE * (F_CPU / 1000000UL)) - CYCLES_EATEN_BY_CODE) { /* nada */ }
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#if HAS_X_STEP
|
|
|
|
#if HAS_X_STEP
|
|
|
@ -688,10 +689,12 @@ void Stepper::isr() {
|
|
|
|
E## INDEX ##_STEP_WRITE(INVERT_E_STEP_PIN); \
|
|
|
|
E## INDEX ##_STEP_WRITE(INVERT_E_STEP_PIN); \
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define CYCLES_EATEN_BY_E 60
|
|
|
|
|
|
|
|
|
|
|
|
// Step all E steppers that have steps
|
|
|
|
// Step all E steppers that have steps
|
|
|
|
for (uint8_t i = 0; i < step_loops; i++) {
|
|
|
|
for (uint8_t i = 0; i < step_loops; i++) {
|
|
|
|
|
|
|
|
|
|
|
|
#if MINIMUM_STEPPER_PULSE > 0
|
|
|
|
#if STEP_PULSE_CYCLES > CYCLES_EATEN_BY_E
|
|
|
|
static uint32_t pulse_start;
|
|
|
|
static uint32_t pulse_start;
|
|
|
|
pulse_start = TCNT0;
|
|
|
|
pulse_start = TCNT0;
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
@ -708,9 +711,8 @@ void Stepper::isr() {
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
// For a minimum pulse time wait before stopping pulses
|
|
|
|
// For a minimum pulse time wait before stopping pulses
|
|
|
|
#if MINIMUM_STEPPER_PULSE > 0
|
|
|
|
#if STEP_PULSE_CYCLES > CYCLES_EATEN_BY_E
|
|
|
|
#define CYCLES_EATEN_BY_E 10
|
|
|
|
while ((uint32_t)(TCNT0 - pulse_start) < STEP_PULSE_CYCLES - CYCLES_EATEN_BY_E) { /* nada */ }
|
|
|
|
while ((uint32_t)(TCNT0 - pulse_start) < (MINIMUM_STEPPER_PULSE * (F_CPU / 1000000UL)) - CYCLES_EATEN_BY_E) { /* nada */ }
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
STOP_E_PULSE(0);
|
|
|
|
STOP_E_PULSE(0);
|
|
|
|