Added USN meter

This commit is contained in:
Sjef Verhoeven PE5PVB
2025-02-10 11:59:04 +01:00
parent 080935638e
commit 7b2ba01fb8
2 changed files with 23 additions and 9 deletions
+18 -5
View File
@@ -318,9 +318,12 @@ int16_t SAvg;
int16_t SAvg2;
int16_t SAvg3;
int16_t SAvg4;
int16_t SAvg5;
int16_t SStatus;
int16_t MP;
int16_t US;
int8_t MPold = 0;
int8_t USold = 0;
int8_t LevelOffset;
int8_t LowLevelSet;
int8_t NTPoffset;
@@ -3291,6 +3294,7 @@ void ShowSignalLevel() {
SAvg = (((SAvg * 9) + 5) / 10) + SStatus;
SAvg2 = (((SAvg2 * 9) + 5) / 10) + CN;
SAvg4 = (((SAvg4 * 9) + 5) / 10) + WAM;
SAvg5 = (((SAvg5 * 9) + 5) / 10) + USN;
float sval = 0;
int16_t smeter = 0;
@@ -3309,28 +3313,37 @@ void ShowSignalLevel() {
SStatus = SAvg / 10;
CN = SAvg2 / 10;
MP = SAvg4 / 10;
US = SAvg5 / 10;
if (!screenmute) {
if (millis() >= SNRupdatetimer + TIMER_SNR_TIMER) {
SNRupdatetimer = millis();
if (!advancedRDS) {
if (CN > (CNold + 1) || CN < (CNold - 1)) {
if (CNold == 0) tftPrint(1, "--", 297, 163, BackgroundColor, BackgroundColor, 16); else tftPrint(1, String(CNold), 297, 163, BackgroundColor, BackgroundColor, 16);
if (CNold == 0) tftPrint(1, "--", 248, 163, BackgroundColor, BackgroundColor, 16); else tftPrint(1, String(CNold), 248, 163, BackgroundColor, BackgroundColor, 16);
if (tuned) {
if (CN == 0) tftPrint(1, "--", 297, 163, PrimaryColor, PrimaryColorSmooth, 16); else tftPrint(1, String(CN), 297, 163, PrimaryColor, PrimaryColorSmooth, 16);
if (CN == 0) tftPrint(1, "--", 248, 163, PrimaryColor, PrimaryColorSmooth, 16); else tftPrint(1, String(CN), 248, 163, PrimaryColor, PrimaryColorSmooth, 16);
CNold = CN;
} else {
tftPrint(1, "--", 297, 163, PrimaryColor, PrimaryColorSmooth, 16);
tftPrint(1, "--", 248, 163, PrimaryColor, PrimaryColorSmooth, 16);
CNold = 0;
}
}
byte MPprint;
MPprint = constrain(map(MP, 0, 1000, 0, 99), 0, 99);
if (MP != MPold) {
tftReplace(1, String(MPold), (band < BAND_GAP ? String(MPprint) : "--"), 248, 163, PrimaryColor, PrimaryColorSmooth, BackgroundColor, 16);
if (MPprint != MPold) {
tftReplace(1, String(MPold), (band < BAND_GAP ? String(MPprint) : "--"), 318, 163, PrimaryColor, PrimaryColorSmooth, BackgroundColor, 16);
MPold = MPprint;
}
byte USprint;
USprint = constrain(map(US, 0, 1000, 0, 99), 0, 99);
if (USprint != USold) {
tftReplace(1, String(USold), (band < BAND_GAP ? String(USprint) : "--"), 318, 145, PrimaryColor, PrimaryColorSmooth, BackgroundColor, 16);
USold = USprint;
}
}
}
+5 -4
View File
@@ -3006,10 +3006,11 @@ void BuildDisplay() {
}
}
}
if (usesquelch || autosquelch) tftPrint(-1, "SQ:", 212, 145, ActiveColor, ActiveColorSmooth, 16);
tftPrint(-1, "MP", 212, 163, ActiveColor, ActiveColorSmooth, 16);
tftPrint(1, "C/N", 278, 163, ActiveColor, ActiveColorSmooth, 16);
tftPrint(-1, "dB", 300, 163, ActiveColor, ActiveColorSmooth, 16);
if (usesquelch || autosquelch) tftPrint(-1, "SQ", 212, 145, ActiveColor, ActiveColorSmooth, 16);
tftPrint(-1, "US", 283, 145, ActiveColor, ActiveColorSmooth, 16);
tftPrint(-1, "MP", 283, 163, ActiveColor, ActiveColorSmooth, 16);
tftPrint(-1, "CN", 212, 163, ActiveColor, ActiveColorSmooth, 16);
tftPrint(1, "dB", 270, 163, ActiveColor, ActiveColorSmooth, 16);
tftPrint(0, "S", 7, 101, ActiveColor, ActiveColorSmooth, 16);
tftPrint(-1, "1", 24, 115, ActiveColor, ActiveColorSmooth, 16);