From fb4418b952948074dcce040f5dd2b593bf82ad20 Mon Sep 17 00:00:00 2001 From: m1nl Date: Fri, 27 Jun 2025 21:41:23 +0200 Subject: [PATCH] fix failing build for rak4631_eth_gw --- src/main.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index ccf8e788f..8bcab635f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -253,8 +253,15 @@ static int32_t ledBlinker() ledBlink.set(ledOn); + // we don't have much control over timing when light-sleeping, so let's ensure we don't keep LED on for too long +#if MESHTASTIC_EXCLUDE_POWER_FSM + bool isSleeping = false; +#else + bool isSleeping = powerFSM.getState() == &stateLS; +#endif + // have a very sparse duty cycle of LED being on, unless charging, then blink 0.5Hz square wave rate to indicate that - return (powerStatus->getIsCharging() && powerFSM.getState() != &stateLS) ? 1000 : (ledOn ? 1 : 1000); + return (powerStatus->getIsCharging() && !isSleeping) ? 1000 : (ledOn ? 1 : 1000); } uint32_t timeLastPowered = 0;