Browse Source

Protect Babystepping against other ISRs

Especialy against stepper ISR.
This is even more important when a minimum pulse width is set,
increasing the runtime of a babystep.
pull/1/head
Sebastianv650 8 years ago
parent
commit
bf57eb2447
  1. 2
      Marlin/stepper.cpp

2
Marlin/stepper.cpp

@ -1250,6 +1250,7 @@ void Stepper::report_positions() {
// MUST ONLY BE CALLED BY AN ISR, // MUST ONLY BE CALLED BY AN ISR,
// No other ISR should ever interrupt this! // No other ISR should ever interrupt this!
void Stepper::babystep(const AxisEnum axis, const bool direction) { void Stepper::babystep(const AxisEnum axis, const bool direction) {
cli();
static uint8_t old_pin; static uint8_t old_pin;
#if STEP_PULSE_CYCLES > CYCLES_EATEN_BY_BABYSTEP #if STEP_PULSE_CYCLES > CYCLES_EATEN_BY_BABYSTEP
static uint32_t pulse_start; static uint32_t pulse_start;
@ -1336,6 +1337,7 @@ void Stepper::report_positions() {
default: break; default: break;
} }
sei();
} }
#endif //BABYSTEPPING #endif //BABYSTEPPING

Loading…
Cancel
Save