From 250cf16bf8793aefed95b9cedb9c20b2f2e7a2a7 Mon Sep 17 00:00:00 2001 From: Andrew Yong Date: Mon, 22 Apr 2024 21:21:50 +0800 Subject: [PATCH] Add ability to turn off heartbeat LED blinking (#3674) * Add ability to turn off status LED blinking Fixes #3635 and depends on [protobufs PR #485](https://github.com/meshtastic/protobufs/pull/485) Signed-off-by: Andrew Yong * led_heartbeat_disabled * trunk --------- Signed-off-by: Andrew Yong Co-authored-by: Ben Meadors --- src/main.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index b1a15634f..f40fd0789 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -179,6 +179,11 @@ const char *getDeviceName() static int32_t ledBlinker() { + // Still set up the blinking (heartbeat) interval but skip code path below, so LED will blink if + // config.device.led_heartbeat_disabled is changed + if (config.device.led_heartbeat_disabled) + return 1000; + static bool ledOn; ledOn ^= 1; @@ -1001,4 +1006,4 @@ void loop() mainDelay.delay(delayMsec); } // if (didWake) LOG_DEBUG("wake!\n"); -} \ No newline at end of file +}