Skip to content

Commit

Permalink
Fix timer interval for battery and RSSI LED indication (#13412)
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveCEvans committed Mar 4, 2024
1 parent 47f3c31 commit ddc81cb
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/main/io/ledstrip.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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;
}
}
}

Expand Down

0 comments on commit ddc81cb

Please sign in to comment.