From ddc81cb4faf4f2eb4de19e342f438beda53224a3 Mon Sep 17 00:00:00 2001 From: Steve Evans Date: Mon, 4 Mar 2024 13:29:38 +0100 Subject: [PATCH] Fix timer interval for battery and RSSI LED indication (#13412) --- src/main/io/ledstrip.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/main/io/ledstrip.c b/src/main/io/ledstrip.c index 4a6401172f9..bd90a3ae8c5 100644 --- a/src/main/io/ledstrip.c +++ b/src/main/io/ledstrip.c @@ -753,7 +753,6 @@ static void applyLedBatteryLayer(bool updateNow, timeUs_t *timer) int timerDelayUs = HZ_TO_US(1); if (updateNow) { - switch (getBatteryState()) { case BATTERY_OK: flash = true; @@ -771,9 +770,9 @@ static void applyLedBatteryLayer(bool updateNow, timeUs_t *timer) break; } - } - *timer += timerDelayUs; + *timer += timerDelayUs; + } if (!flash) { const hsvColor_t *bgc = getSC(LED_SCOLOR_BACKGROUND); @@ -800,9 +799,9 @@ static void applyLedRssiLayer(bool updateNow, timeUs_t *timer) flash = !flash; timerDelay = HZ_TO_US(8); } - } - *timer += timerDelay; + *timer += timerDelay; + } if (!flash) { const hsvColor_t *bgc = getSC(LED_SCOLOR_BACKGROUND); @@ -1130,9 +1129,9 @@ static ledProfileSequence_t applyStatusProfile(timeUs_t now) timerVal[timId] = now; } - if (delta < 0) - continue; // not ready yet - timActive |= 1 << timId; + if (delta >= 0) { + timActive |= 1 << timId; + } } }