Slow down display of BW and SNR

Add a timer for display.
This commit is contained in:
kevin
2023-06-18 21:07:45 +08:00
parent 1c92648668
commit c62d406d87
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 SWMIBandstringold = String();
int lowsignaltimer;
int bwupdatetimer;
int snrupdatetimer;
int menuoption = 30;
int MStatusold;
int OStatusold;
@@ -2809,6 +2811,9 @@ void ShowSignalLevel() {
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 (millis() >= snrupdatetimer + TIMER_500_TICK) {
snrupdatetimer = millis();
if (SNR > (SNRold + 1) || SNR < (SNRold - 1)) {
tft.setFreeFont(FONT7);
tft.setTextColor(TFT_BLACK);
@@ -2822,6 +2827,7 @@ void ShowSignalLevel() {
SNRold = 99;
}
}
}
SAvg = (((SAvg * 9) + 5) / 10) + SStatus;
SAvg2 = (((SAvg2 * 9) + 5) / 10) + SNR;
@@ -3134,6 +3140,9 @@ void doSquelch() {
}
void updateBW() {
if (millis() >= bwupdatetimer + TIMER_500_TICK) {
bwupdatetimer = millis();
tft.setFreeFont(FONT7);
if (BWset == 0) {
if (screenmute == false) {
@@ -3148,6 +3157,7 @@ void updateBW() {
}
}
tft.drawCentreString("AUTO BW", 282, 33, GFXFF);
}
}
void updateiMS() {
+4
View File
@@ -19,6 +19,10 @@ enum RADIO_TUNE_MODE {
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_WARN 1700
#define BAT_LEVEL_FULL 2270