From 0f6934f4a1e255112fb46eb721f0c592f5f4c704 Mon Sep 17 00:00:00 2001 From: Kai Lauterbach Date: Mon, 9 Jan 2023 12:07:01 +0100 Subject: [PATCH] Improved wdt code --- firmware/firmware.ino | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/firmware/firmware.ino b/firmware/firmware.ino index a42930e..14d7dae 100644 --- a/firmware/firmware.ino +++ b/firmware/firmware.ino @@ -1,6 +1,7 @@ // Standard ESP8266 libs from project folder #include #include +#include #include // WiFiClient @@ -132,8 +133,11 @@ void setup() { #else // not in battery mode #ifdef ENABLE_WATCHDOG + wdt_disable(); + wdt_reset(); // Enable the internal watchdog - ESP.wdtEnable(WATCHDOG_TIMEOUT_MS); + wdt_enable(WATCHDOG_TIMEOUT_MS); + debug("Watchdog enabled"); #endif #endif } @@ -358,7 +362,7 @@ void criticalBatCheck() { void loop() { #ifdef ENABLE_WATCHDOG - ESP.wdtFeed(); + WDT_FEED(); #endif #ifdef BATTERY_POWERED