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

Loading…
Cancel
Save