mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-13 19:40:31 +03:00
Fix timer interval for battery and RSSI LED indication (#13412)
This commit is contained in:
parent
47f3c31f54
commit
ddc81cb4fa
1 changed files with 7 additions and 8 deletions
|
@ -753,7 +753,6 @@ static void applyLedBatteryLayer(bool updateNow, timeUs_t *timer)
|
||||||
int timerDelayUs = HZ_TO_US(1);
|
int timerDelayUs = HZ_TO_US(1);
|
||||||
|
|
||||||
if (updateNow) {
|
if (updateNow) {
|
||||||
|
|
||||||
switch (getBatteryState()) {
|
switch (getBatteryState()) {
|
||||||
case BATTERY_OK:
|
case BATTERY_OK:
|
||||||
flash = true;
|
flash = true;
|
||||||
|
@ -771,9 +770,9 @@ static void applyLedBatteryLayer(bool updateNow, timeUs_t *timer)
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
*timer += timerDelayUs;
|
*timer += timerDelayUs;
|
||||||
|
}
|
||||||
|
|
||||||
if (!flash) {
|
if (!flash) {
|
||||||
const hsvColor_t *bgc = getSC(LED_SCOLOR_BACKGROUND);
|
const hsvColor_t *bgc = getSC(LED_SCOLOR_BACKGROUND);
|
||||||
|
@ -800,9 +799,9 @@ static void applyLedRssiLayer(bool updateNow, timeUs_t *timer)
|
||||||
flash = !flash;
|
flash = !flash;
|
||||||
timerDelay = HZ_TO_US(8);
|
timerDelay = HZ_TO_US(8);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
*timer += timerDelay;
|
*timer += timerDelay;
|
||||||
|
}
|
||||||
|
|
||||||
if (!flash) {
|
if (!flash) {
|
||||||
const hsvColor_t *bgc = getSC(LED_SCOLOR_BACKGROUND);
|
const hsvColor_t *bgc = getSC(LED_SCOLOR_BACKGROUND);
|
||||||
|
@ -1130,11 +1129,11 @@ static ledProfileSequence_t applyStatusProfile(timeUs_t now)
|
||||||
timerVal[timId] = now;
|
timerVal[timId] = now;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (delta < 0)
|
if (delta >= 0) {
|
||||||
continue; // not ready yet
|
|
||||||
timActive |= 1 << timId;
|
timActive |= 1 << timId;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!timActive) {
|
if (!timActive) {
|
||||||
return LED_PROFILE_SLOW; // no change this update, keep old state
|
return LED_PROFILE_SLOW; // no change this update, keep old state
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue