mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-25 17:25:20 +03:00
Revert "Prevent crashing when OSD timers are configured incorrectly."
This reverts commit db2f3641c92a7db1aec93581592861860f292b23.
This commit is contained in:
parent
0e5b9cdd5c
commit
a56ac05303
2 changed files with 4 additions and 14 deletions
|
@ -205,10 +205,6 @@ static long menuTimersOnEnter(void)
|
||||||
timerSource[i] = OSD_TIMER_SRC(timer);
|
timerSource[i] = OSD_TIMER_SRC(timer);
|
||||||
timerPrecision[i] = OSD_TIMER_PRECISION(timer);
|
timerPrecision[i] = OSD_TIMER_PRECISION(timer);
|
||||||
timerAlarm[i] = OSD_TIMER_ALARM(timer);
|
timerAlarm[i] = OSD_TIMER_ALARM(timer);
|
||||||
if ((int)timerSource[i] >= (int)OSD_TIMER_SRC_COUNT)
|
|
||||||
timerSource[i] = OSD_TIMER_SRC_ON;
|
|
||||||
if ((int)timerPrecision[i] >= (int)OSD_TIMER_PREC_COUNT)
|
|
||||||
timerPrecision[i] = OSD_TIMER_PREC_SECOND;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -483,19 +483,13 @@ static void osdShowStats(uint16_t endBatteryVoltage)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (osdStatGetState(OSD_STAT_TIMER_1)) {
|
if (osdStatGetState(OSD_STAT_TIMER_1)) {
|
||||||
int src = OSD_TIMER_SRC(osdConfig()->timers[OSD_TIMER_1]);
|
osdFormatTimer(buff, false, (OSD_TIMER_SRC(osdConfig()->timers[OSD_TIMER_1]) == OSD_TIMER_SRC_ON ? false : true), OSD_TIMER_1);
|
||||||
if (src >= OSD_TIMER_SRC_COUNT)
|
osdDisplayStatisticLabel(top++, osdTimerSourceNames[OSD_TIMER_SRC(osdConfig()->timers[OSD_TIMER_1])], buff);
|
||||||
src = 0;
|
|
||||||
osdFormatTimer(buff, false, (src == OSD_TIMER_SRC_ON ? false : true), OSD_TIMER_1);
|
|
||||||
osdDisplayStatisticLabel(top++, osdTimerSourceNames[src], buff);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (osdStatGetState(OSD_STAT_TIMER_2)) {
|
if (osdStatGetState(OSD_STAT_TIMER_2)) {
|
||||||
int src = OSD_TIMER_SRC(osdConfig()->timers[OSD_TIMER_2]);
|
osdFormatTimer(buff, false, (OSD_TIMER_SRC(osdConfig()->timers[OSD_TIMER_2]) == OSD_TIMER_SRC_ON ? false : true), OSD_TIMER_2);
|
||||||
if (src >= OSD_TIMER_SRC_COUNT)
|
osdDisplayStatisticLabel(top++, osdTimerSourceNames[OSD_TIMER_SRC(osdConfig()->timers[OSD_TIMER_2])], buff);
|
||||||
src = 0;
|
|
||||||
osdFormatTimer(buff, false, (src == OSD_TIMER_SRC_ON ? false : true), OSD_TIMER_2);
|
|
||||||
osdDisplayStatisticLabel(top++, osdTimerSourceNames[src], buff);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (osdStatGetState(OSD_STAT_MAX_ALTITUDE)) {
|
if (osdStatGetState(OSD_STAT_MAX_ALTITUDE)) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue