Fix interrupt-based endstop detection
This commit is contained in:
@@ -1449,23 +1449,8 @@ void Planner::quick_stop() {
|
||||
}
|
||||
|
||||
void Planner::endstop_triggered(const AxisEnum axis) {
|
||||
|
||||
/*NB: This will be called via endstops.update()
|
||||
and endstops.update() can be called from the temperature
|
||||
ISR. So Stepper interrupts are enabled */
|
||||
|
||||
// Disable stepper ISR
|
||||
bool stepper_isr_enabled = STEPPER_ISR_ENABLED();
|
||||
DISABLE_STEPPER_DRIVER_INTERRUPT();
|
||||
|
||||
// Record stepper position
|
||||
// Record stepper position and discard the current block
|
||||
stepper.endstop_triggered(axis);
|
||||
|
||||
// Discard the active block that led to the trigger
|
||||
discard_current_block();
|
||||
|
||||
// Reenable stepper ISR if it was enabled
|
||||
if (stepper_isr_enabled) ENABLE_STEPPER_DRIVER_INTERRUPT();
|
||||
}
|
||||
|
||||
float Planner::triggered_position_mm(const AxisEnum axis) {
|
||||
|
||||
Reference in New Issue
Block a user