1
0
Fork 0
mirror of https://github.com/iNavFlight/inav.git synced 2025-07-20 23:05:17 +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; break;
case OSD_CRSF_SNR_DB: { case OSD_CRSF_SNR_DB: {
const char* hidesnr = " "; const char* showsnr = " -12";
const char* hidesnr = " ";
int16_t osdSNR_Alarm = rxLinkStatistics.uplinkSNR; int16_t osdSNR_Alarm = rxLinkStatistics.uplinkSNR;
if (osdSNR_Alarm <= osdConfig()->snr_alarm) { if (osdSNR_Alarm <= osdConfig()->snr_alarm) {
buff[0] = SYM_SRN; buff[0] = SYM_SRN;
tfp_sprintf(buff + 1, "%4d%c", rxLinkStatistics.uplinkSNR, SYM_DB); tfp_sprintf(buff + 1, "%4d%c", rxLinkStatistics.uplinkSNR, SYM_DB);
} }
else if (osdSNR_Alarm > osdConfig()->snr_alarm) { else if (osdSNR_Alarm > osdConfig()->snr_alarm) {
//displayWrite(osdDisplayPort, elemPosX, elemPosY, " "); if (cmsInMenu) {
buff[0] = SYM_SRN; buff[0] = SYM_SRN;
tfp_sprintf(buff + 1, "%s%c", hidesnr, SYM_DB); tfp_sprintf(buff + 1, "%s%c", showsnr, SYM_DB);
} else {
buff[0] = SYM_BLANK;
tfp_sprintf(buff + 1, "%s%c", hidesnr);
}
} }
break; break;
} }
@ -3223,7 +3228,7 @@ void osdUpdate(timeUs_t currentTimeUs)
else else
#ifdef USE_PROGRAMMING_FRAMEWORK #ifdef USE_PROGRAMMING_FRAMEWORK
if (LOGIC_CONDITION_GLOBAL_FLAG(LOGIC_CONDITION_GLOBAL_FLAG_OVERRIDE_OSD_LAYOUT)) if (LOGIC_CONDITION_GLOBAL_FLAG(LOGIC_CONDITION_GLOBAL_FLAG_OVERRIDE_OSD_LAYOUT))
activeLayout = constrain(logicConditionValuesByType[LOGIC_CONDITION_SET_OSD_LAYOUT], 0, OSD_ALTERNATE_LAYOUT_COUNT); activeLayout = constrain(logicConditionValuesByType[LOGIC_CONDITION_SET_OSD_LAYOUT], 0, OSD_ALTERNATE_LAYOUT_COUNT);
else else
#endif #endif
activeLayout = 0; activeLayout = 0;