From 6df1f0bb26c287b76f60d4decc4b8ca994caa8bc Mon Sep 17 00:00:00 2001 From: stefanbode Date: Fri, 28 Jan 2022 16:15:48 +0100 Subject: [PATCH] added compiler option: #ifdef DEEPSLEEP_NETWORK_TIMEOUT additional code optional compiled --- tasmota/xdrv_29_deepsleep.ino | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tasmota/xdrv_29_deepsleep.ino b/tasmota/xdrv_29_deepsleep.ino index 17ef2d896..9db9c8ba6 100644 --- a/tasmota/xdrv_29_deepsleep.ino +++ b/tasmota/xdrv_29_deepsleep.ino @@ -1,7 +1,7 @@ /* xdrv_29_deepsleep.ino - DeepSleep support for Tasmota - Copyright (C) 2021 Stefan Bode + Copyright (C) 2022 Stefan Bode This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -154,11 +154,14 @@ void DeepSleepStart(void) void DeepSleepEverySecond(void) { +#ifdef DEEPSLEEP_NETWORK_TIMEOUT //AddLog(LOG_LEVEL_DEBUG_MORE, PSTR("Wifi Info: up %d, wifidown %d, wifistatus %d, flag %d"),TasmotaGlobal.uptime, TasmotaGlobal.global_state.wifi_down, Wifi.status , deepsleep_flag); if (DEEPSLEEP_NETWORK_TIMEOUT && TasmotaGlobal.uptime > DEEPSLEEP_NETWORK_TIMEOUT && Wifi.status != WL_CONNECTED && !deepsleep_flag && DeepSleepEnabled()) { AddLog(LOG_LEVEL_ERROR, PSTR("Error Wifi could not connect 15 seconds. Deepsleep") ); deepsleep_flag = DEEPSLEEP_START_COUNTDOWN; // Start deepsleep in 4 seconds } +#endif // DEEPSLEEP_NETWORK_TIMEOUT + if (!deepsleep_flag) { return; } if (DeepSleepEnabled()) {