Skip to content

Commit 3ec5d6d

Browse files
⚡️ Exit from ISR on AVR already does sei
Co-Authored-By: tombrazier <[email protected]>
1 parent 75aa880 commit 3ec5d6d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Marlin/src/module/stepper.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1600,8 +1600,11 @@ void Stepper::isr() {
16001600
// Set the next ISR to fire at the proper time
16011601
HAL_timer_set_compare(MF_TIMER_STEP, hal_timer_t(next_isr_ticks));
16021602

1603-
// Don't forget to finally reenable interrupts
1604-
hal.isr_on();
1603+
// Don't forget to finally reenable interrupts on non-AVR.
1604+
// AVR automatically calls sei() for us on Return-from-Interrupt.
1605+
#ifndef __AVR__
1606+
hal.isr_on();
1607+
#endif
16051608
}
16061609

16071610
#if MINIMUM_STEPPER_PULSE || MAXIMUM_STEPPER_RATE

0 commit comments

Comments
 (0)