diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 0a2b331b6..6ab70bcc2 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -84,6 +84,7 @@ #include "Prusa_farm.h" #include +#include #include #include "Tcodes.h" @@ -692,10 +693,11 @@ void watchdogEarlyDisable(void) { // leaving it enabled when jumping to the program. This could cause another watchdog reset // during setup() if not handled properly. So to avoid any issue of this kind, stop the // watchdog timer manually. - cli(); - wdt_reset(); - MCUSR &= ~_BV(WDRF); - wdt_disable(); + ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + wdt_reset(); + MCUSR &= ~_BV(WDRF); + wdt_disable(); + } } void softReset(void) {