From c34947ebe4ad6076a329fdb47654dfede169fddf Mon Sep 17 00:00:00 2001 From: "Peter C. S. Scholtens" Date: Sun, 7 Mar 2021 19:15:02 +0100 Subject: [PATCH] Update WatchdogAVR.cpp My arduino IDE includes the file arduino-1.8.13/hardware/tools/avr/avr/include/avr/sleep.h which contains already a sleep_disable() call, see the definition below. So it can be removed? Or is this done differently in the various boards? #define sleep_mode() \ do { \ sleep_enable(); \ sleep_cpu(); \ sleep_disable(); \ } while (0) --- utility/WatchdogAVR.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/utility/WatchdogAVR.cpp b/utility/WatchdogAVR.cpp index cb5e344..17a1aa9 100644 --- a/utility/WatchdogAVR.cpp +++ b/utility/WatchdogAVR.cpp @@ -75,9 +75,6 @@ int WatchdogAVR::sleep(int maxPeriodMS) { // Chip is now asleep! - // Once awakened by the watchdog execution resumes here. - // Start by disabling sleep. - sleep_disable(); // Check if user had the watchdog enabled before sleep and re-enable it. if (_wdto != -1)