1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-25 01:05:27 +03:00

Use coloured fonts if supported (#13005)

This commit is contained in:
Steve Evans 2023-08-06 09:06:50 +01:00 committed by GitHub
parent 5d29a0be06
commit fb9587b2ec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 27 additions and 7 deletions

View file

@ -1498,13 +1498,18 @@ static void osdElementRtcTime(osdElementParms_t *element)
static void osdElementRssiDbm(osdElementParms_t *element)
{
const int8_t antenna = getActiveAntenna();
const int16_t osdRssiDbm = getRssiDbm();
static bool diversity = false;
if (osdRssiDbm < osdConfig()->rssi_dbm_alarm) {
element->attr = DISPLAYPORT_SEVERITY_CRITICAL;
}
if (antenna || diversity) {
diversity = true;
tfp_sprintf(element->buff, "%c%3d:%d", SYM_RSSI, getRssiDbm(), antenna + 1);
tfp_sprintf(element->buff, "%c%3d:%d", SYM_RSSI, osdRssiDbm, antenna + 1);
} else {
tfp_sprintf(element->buff, "%c%3d", SYM_RSSI, getRssiDbm());
tfp_sprintf(element->buff, "%c%3d", SYM_RSSI, osdRssiDbm);
}
}
#endif // USE_RX_RSSI_DBM
@ -2144,6 +2149,14 @@ void osdUpdateAlarms(void)
CLR_BLINK(OSD_RSSI_VALUE);
}
#ifdef USE_RX_RSSI_DBM
if (getRssiDbm() < osdConfig()->rssi_dbm_alarm) {
SET_BLINK(OSD_RSSI_DBM_VALUE);
} else {
CLR_BLINK(OSD_RSSI_DBM_VALUE);
}
#endif
#ifdef USE_RX_LINK_QUALITY_INFO
if (rxGetLinkQualityPercent() < osdConfig()->link_quality_alarm) {
SET_BLINK(OSD_LINK_QUALITY);