From cb66bff9246534c11acea192deae4ab6281b64c6 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 11 Mar 2023 19:17:25 -0600 Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20Exit=20from=20ISR=20on=20A?= =?UTF-8?q?VR=20already=20does=20sei?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: tombrazier <68918209+tombrazier@users.noreply.github.com> --- Marlin/src/module/stepper.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp index d0398b404c7f..b54b9668eac2 100644 --- a/Marlin/src/module/stepper.cpp +++ b/Marlin/src/module/stepper.cpp @@ -1600,8 +1600,11 @@ void Stepper::isr() { // Set the next ISR to fire at the proper time HAL_timer_set_compare(MF_TIMER_STEP, hal_timer_t(next_isr_ticks)); - // Don't forget to finally reenable interrupts - hal.isr_on(); + // Don't forget to finally reenable interrupts on non-AVR. + // AVR automatically calls sei() for us on Return-from-Interrupt. + #ifndef __AVR__ + hal.isr_on(); + #endif } #if MINIMUM_STEPPER_PULSE || MAXIMUM_STEPPER_RATE