Merge pull request #32 from ohmytime/main

Slow down display of BW and SNR
This commit is contained in:
Sjef Verhoeven PE5PVB
2023-06-18 19:44:09 +02:00
committed by GitHub
2 changed files with 37 additions and 23 deletions
+10
View File
@@ -141,6 +141,8 @@ uint16_t SWMIBandPosold; // Fix Me: Should store this parameter into flash, for
String SWMIBandstring = String(); String SWMIBandstring = String();
String SWMIBandstringold = String(); String SWMIBandstringold = String();
int lowsignaltimer; int lowsignaltimer;
int bwupdatetimer;
int snrupdatetimer;
int menuoption = 30; int menuoption = 30;
int MStatusold; int MStatusold;
int OStatusold; int OStatusold;
@@ -2810,6 +2812,9 @@ void ShowSignalLevel() {
if (screenmute == false) { if (screenmute == false) {
if (band == BAND_FM) SNR = int(0.46222375 * (float)(SStatus / 10) - 0.082495118 * (float)(USN / 10)) + 10; else SNR = -((int8_t)(USN / 10)); if (band == BAND_FM) SNR = int(0.46222375 * (float)(SStatus / 10) - 0.082495118 * (float)(USN / 10)) + 10; else SNR = -((int8_t)(USN / 10));
if (millis() >= snrupdatetimer + TIMER_500_TICK) {
snrupdatetimer = millis();
if (SNR > (SNRold + 1) || SNR < (SNRold - 1)) { if (SNR > (SNRold + 1) || SNR < (SNRold - 1)) {
tft.setFreeFont(FONT7); tft.setFreeFont(FONT7);
tft.setTextColor(TFT_BLACK); tft.setTextColor(TFT_BLACK);
@@ -2823,6 +2828,7 @@ void ShowSignalLevel() {
SNRold = 99; SNRold = 99;
} }
} }
}
SAvg = (((SAvg * 9) + 5) / 10) + SStatus; SAvg = (((SAvg * 9) + 5) / 10) + SStatus;
SAvg2 = (((SAvg2 * 9) + 5) / 10) + SNR; SAvg2 = (((SAvg2 * 9) + 5) / 10) + SNR;
@@ -3135,6 +3141,9 @@ void doSquelch() {
} }
void updateBW() { void updateBW() {
if (millis() >= bwupdatetimer + TIMER_500_TICK) {
bwupdatetimer = millis();
tft.setFreeFont(FONT7); tft.setFreeFont(FONT7);
if (BWset == 0) { if (BWset == 0) {
if (screenmute == false) { if (screenmute == false) {
@@ -3149,6 +3158,7 @@ void updateBW() {
} }
} }
tft.drawCentreString("AUTO BW", 282, 33, GFXFF); tft.drawCentreString("AUTO BW", 282, 33, GFXFF);
}
} }
void updateiMS() { void updateiMS() {
+4
View File
@@ -19,6 +19,10 @@ enum RADIO_TUNE_MODE {
TUNE_MAN, TUNE_AUTO, TUNE_MEM, TUNE_MI_BAND TUNE_MAN, TUNE_AUTO, TUNE_MEM, TUNE_MI_BAND
}; };
#define TIMER_BW_TIMER (TIMER_500_TICK)
#define TIMER_SNR_TIMER (TIMER_500_TICK)
#define TIMER_500_TICK 500
#define BAT_LEVEL_EMPTY 1600 #define BAT_LEVEL_EMPTY 1600
#define BAT_LEVEL_WARN 1700 #define BAT_LEVEL_WARN 1700
#define BAT_LEVEL_FULL 2270 #define BAT_LEVEL_FULL 2270