mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-26 01:35:41 +03:00
Merge pull request #4475 from mikeller/order_osd_warnings_by_importance
Ordered priority of OSD warnings by importance.
This commit is contained in:
commit
df6b2dc1be
1 changed files with 11 additions and 11 deletions
|
@ -592,6 +592,13 @@ static void osdDrawSingleElement(uint8_t item)
|
||||||
{
|
{
|
||||||
uint16_t enabledWarnings = osdConfig()->enabledWarnings;
|
uint16_t enabledWarnings = osdConfig()->enabledWarnings;
|
||||||
|
|
||||||
|
const batteryState_e batteryState = getBatteryState();
|
||||||
|
|
||||||
|
if (enabledWarnings & OSD_WARNING_BATTERY_CRITICAL && batteryState == BATTERY_CRITICAL) {
|
||||||
|
tfp_sprintf(buff, " LAND NOW");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
/* Warn when in flip over after crash mode */
|
/* Warn when in flip over after crash mode */
|
||||||
if ((enabledWarnings & OSD_WARNING_CRASH_FLIP)
|
if ((enabledWarnings & OSD_WARNING_CRASH_FLIP)
|
||||||
&& (isModeActivationConditionPresent(BOXFLIPOVERAFTERCRASH))
|
&& (isModeActivationConditionPresent(BOXFLIPOVERAFTERCRASH))
|
||||||
|
@ -612,22 +619,15 @@ static void osdDrawSingleElement(uint8_t item)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Show warning if battery is not fresh */
|
|
||||||
if (enabledWarnings & OSD_WARNING_BATTERY_NOT_FULL && !ARMING_FLAG(WAS_EVER_ARMED) && (getBatteryState() == BATTERY_OK)
|
|
||||||
&& getBatteryAverageCellVoltage() < batteryConfig()->vbatfullcellvoltage) {
|
|
||||||
tfp_sprintf(buff, "BATT NOT FULL");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
const batteryState_e batteryState = getBatteryState();
|
|
||||||
|
|
||||||
if (enabledWarnings & OSD_WARNING_BATTERY_WARNING && batteryState == BATTERY_WARNING) {
|
if (enabledWarnings & OSD_WARNING_BATTERY_WARNING && batteryState == BATTERY_WARNING) {
|
||||||
tfp_sprintf(buff, "LOW BATTERY");
|
tfp_sprintf(buff, "LOW BATTERY");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (enabledWarnings & OSD_WARNING_BATTERY_CRITICAL && batteryState == BATTERY_CRITICAL) {
|
/* Show warning if battery is not fresh */
|
||||||
tfp_sprintf(buff, " LAND NOW");
|
if (enabledWarnings & OSD_WARNING_BATTERY_NOT_FULL && !ARMING_FLAG(WAS_EVER_ARMED) && (getBatteryState() == BATTERY_OK)
|
||||||
|
&& getBatteryAverageCellVoltage() < batteryConfig()->vbatfullcellvoltage) {
|
||||||
|
tfp_sprintf(buff, "BATT NOT FULL");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue