From 5dfa4b837fe87e08ea71b4c8ec0b1d6d65729015 Mon Sep 17 00:00:00 2001 From: todd-herbert Date: Fri, 3 May 2024 12:11:13 +1200 Subject: [PATCH] Ensure LED is off when disabling heartbeat (#3772) --- src/main.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index 063e9b355..c2c824968 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -693,6 +693,12 @@ void setup() // Now that the mesh service is created, create any modules setupModules(); +#ifdef LED_PIN + // Turn LED off after boot, if heartbeat by config + if (config.device.led_heartbeat_disabled) + digitalWrite(LED_PIN, LOW ^ LED_INVERTED); +#endif + // Do this after service.init (because that clears error_code) #ifdef HAS_PMU if (!pmu_found)