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
+33 -23
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,17 +2812,21 @@ 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 (SNR > (SNRold + 1) || SNR < (SNRold - 1)) { if (millis() >= snrupdatetimer + TIMER_500_TICK) {
tft.setFreeFont(FONT7); snrupdatetimer = millis();
tft.setTextColor(TFT_BLACK);
if (SNRold == 99) tft.drawRightString("--", 294, 166, GFXFF); else tft.drawRightString(String(SNRold), 294, 166, GFXFF); if (SNR > (SNRold + 1) || SNR < (SNRold - 1)) {
tft.setTextColor(TFT_YELLOW, TFT_BLACK); tft.setFreeFont(FONT7);
if (tuned == true) { tft.setTextColor(TFT_BLACK);
tft.drawRightString(String(SNR), 294, 166, GFXFF); if (SNRold == 99) tft.drawRightString("--", 294, 166, GFXFF); else tft.drawRightString(String(SNRold), 294, 166, GFXFF);
SNRold = SNR; tft.setTextColor(TFT_YELLOW, TFT_BLACK);
} else { if (tuned == true) {
tft.drawRightString("--", 294, 166, GFXFF); tft.drawRightString(String(SNR), 294, 166, GFXFF);
SNRold = 99; SNRold = SNR;
} else {
tft.drawRightString("--", 294, 166, GFXFF);
SNRold = 99;
}
} }
} }
@@ -3135,20 +3141,24 @@ void doSquelch() {
} }
void updateBW() { void updateBW() {
tft.setFreeFont(FONT7); if (millis() >= bwupdatetimer + TIMER_500_TICK) {
if (BWset == 0) { bwupdatetimer = millis();
if (screenmute == false) {
tft.drawRoundRect(249, 35, 68, 20, 5, TFT_WHITE); tft.setFreeFont(FONT7);
tft.setTextColor(TFT_WHITE); if (BWset == 0) {
} if (screenmute == false) {
radio.setFMABandw(); tft.drawRoundRect(249, 35, 68, 20, 5, TFT_WHITE);
} else { tft.setTextColor(TFT_WHITE);
if (screenmute == false) { }
tft.drawRoundRect(249, 35, 68, 20, 5, TFT_GREYOUT); radio.setFMABandw();
tft.setTextColor(TFT_GREYOUT); } else {
if (screenmute == false) {
tft.drawRoundRect(249, 35, 68, 20, 5, TFT_GREYOUT);
tft.setTextColor(TFT_GREYOUT);
}
} }
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