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.
Sebastianv650 8 years ago
parent
commit
bf57eb2447
1 changed files with 2 additions and 0 deletions
  1. 2
    0
      Marlin/stepper.cpp

+ 2
- 0
Marlin/stepper.cpp View File

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

Loading…
Cancel
Save