1
0
Fork 0
mirror of https://github.com/iNavFlight/inav.git synced 2025-07-20 14:55:18 +03:00

Update to SNR

This update hides the SNR and dB symbols when not in use and shows a preview inside the CMS.
This commit is contained in:
OptimusTi 2020-09-08 23:03:39 -04:00
parent 03098fa18a
commit b0c0b5110c

View file

@ -1660,16 +1660,21 @@ static bool osdDrawSingleElement(uint8_t item)
break;
case OSD_CRSF_SNR_DB: {
const char* hidesnr = " ";
const char* showsnr = " -12";
const char* hidesnr = " ";
int16_t osdSNR_Alarm = rxLinkStatistics.uplinkSNR;
if (osdSNR_Alarm <= osdConfig()->snr_alarm) {
buff[0] = SYM_SRN;
tfp_sprintf(buff + 1, "%4d%c", rxLinkStatistics.uplinkSNR, SYM_DB);
}
else if (osdSNR_Alarm > osdConfig()->snr_alarm) {
//displayWrite(osdDisplayPort, elemPosX, elemPosY, " ");
buff[0] = SYM_SRN;
tfp_sprintf(buff + 1, "%s%c", hidesnr, SYM_DB);
if (cmsInMenu) {
buff[0] = SYM_SRN;
tfp_sprintf(buff + 1, "%s%c", showsnr, SYM_DB);
} else {
buff[0] = SYM_BLANK;
tfp_sprintf(buff + 1, "%s%c", hidesnr);
}
}
break;
}