UI tweaks

This commit is contained in:
MCelliotG
2025-02-06 03:57:47 +02:00
committed by GitHub
parent 6c31ab38cb
commit ee2e338710
+65 -65
View File
@@ -1002,7 +1002,7 @@ void loop() {
if (shouldScan) { if (shouldScan) {
if (scanmute && scanholdonsignal) { if (scanmute && scanholdonsignal) {
radio.setMute(); radio.setMute();
if (!screenmute) tft.drawBitmap(92, 4, Speaker, 26, 22, PrimaryColor); if (!screenmute) tft.drawBitmap(2, 4, Speaker, 26, 22, PrimaryColor);
SQ = true; SQ = true;
} }
scanholdflag = false; scanholdflag = false;
@@ -1044,7 +1044,7 @@ void loop() {
if (scanmute && scanholdonsignal) { if (scanmute && scanholdonsignal) {
radio.setUnMute(); radio.setUnMute();
SQ = false; SQ = false;
if (!screenmute) tft.drawBitmap(92, 4, Speaker, 26, 22, GreyoutColor); if (!screenmute) tft.drawBitmap(2, 4, Speaker, 26, 22, GreyoutColor);
} }
} }
@@ -1100,7 +1100,7 @@ void loop() {
if (radio.af_counter == 0) { if (radio.af_counter == 0) {
if (findMemoryAF && radio.rds.correctPI != 0 && tunemode == TUNE_MEM && (USN > 250 || WAM > 250)) { if (findMemoryAF && radio.rds.correctPI != 0 && tunemode == TUNE_MEM && (USN > 250 || WAM > 250)) {
radio.setMute(); radio.setMute();
tft.drawBitmap(92, 4, Speaker, 26, 22, PrimaryColor); tft.drawBitmap(2, 4, Speaker, 26, 22, PrimaryColor);
SQ = true; SQ = true;
if (!screenmute) { if (!screenmute) {
if (advancedRDS) { if (advancedRDS) {
@@ -1144,7 +1144,7 @@ void loop() {
radio.setUnMute(); radio.setUnMute();
SQ = false; SQ = false;
tft.drawBitmap(92, 4, Speaker, 26, 22, GreyoutColor); tft.drawBitmap(2, 4, Speaker, 26, 22, GreyoutColor);
} }
findMemoryAF = false; findMemoryAF = false;
} else { } else {
@@ -1270,7 +1270,7 @@ void loop() {
tftPrint(-1, "RT:", 3, 221, GreyoutColor, BackgroundColor, 16); tftPrint(-1, "RT:", 3, 221, GreyoutColor, BackgroundColor, 16);
tftPrint(-1, "PTY:", 3, 163, GreyoutColor, BackgroundColor, 16); tftPrint(-1, "PTY:", 3, 163, GreyoutColor, BackgroundColor, 16);
tft.drawLine(16, 143, 203, 143, GreyoutColor); tft.drawLine(16, 143, 203, 143, GreyoutColor);
tft.drawBitmap(122, 5, RDSLogo, 35, 22, GreyoutColor); tft.drawBitmap(70, 5, RDSLogo, 35, 22, GreyoutColor);
} }
LowLevelInit = false; LowLevelInit = false;
} }
@@ -2350,7 +2350,7 @@ void SelectBand() {
} }
if (band > BAND_GAP) { if (band > BAND_GAP) {
if (!screenmute) tft.drawBitmap(92, 4, Speaker, 26, 22, GreyoutColor); if (!screenmute) tft.drawBitmap(2, 4, Speaker, 26, 22, GreyoutColor);
if (tunemode == TUNE_MI_BAND && band != BAND_SW) tunemode = TUNE_MAN; if (tunemode == TUNE_MI_BAND && band != BAND_SW) tunemode = TUNE_MAN;
BWreset = true; BWreset = true;
BWset = BWsetAM; BWset = BWsetAM;
@@ -2386,7 +2386,7 @@ void SelectBand() {
tftPrint(-1, "PS:", 3, 193, GreyoutColor, BackgroundColor, 16); tftPrint(-1, "PS:", 3, 193, GreyoutColor, BackgroundColor, 16);
tftPrint(-1, "RT:", 3, 221, GreyoutColor, BackgroundColor, 16); tftPrint(-1, "RT:", 3, 221, GreyoutColor, BackgroundColor, 16);
tftPrint(-1, "PTY:", 3, 163, GreyoutColor, BackgroundColor, 16); tftPrint(-1, "PTY:", 3, 163, GreyoutColor, BackgroundColor, 16);
tft.drawBitmap(122, 5, RDSLogo, 35, 22, GreyoutColor); tft.drawBitmap(70, 5, RDSLogo, 35, 22, GreyoutColor);
tft.fillRoundRect(249, 57, 30, 18, 2, GreyoutColor); tft.fillRoundRect(249, 57, 30, 18, 2, GreyoutColor);
tftPrint(0, "iMS", 265, 59, BackgroundColor, GreyoutColor, 16); tftPrint(0, "iMS", 265, 59, BackgroundColor, GreyoutColor, 16);
tft.fillRoundRect(287, 57, 30, 18, 2, GreyoutColor); tft.fillRoundRect(287, 57, 30, 18, 2, GreyoutColor);
@@ -2479,7 +2479,7 @@ void BWButtonPress() {
} else { } else {
if (!usesquelch) radio.setUnMute(); if (!usesquelch) radio.setUnMute();
if (!BWtune && !menu) { if (!BWtune && !menu) {
if (!screenmute) tft.drawBitmap(92, 4, Speaker, 26, 22, GreyoutColor); if (!screenmute) tft.drawBitmap(2, 4, Speaker, 26, 22, GreyoutColor);
unsigned long counterold = millis(); unsigned long counterold = millis();
unsigned long counter = millis(); unsigned long counter = millis();
while (digitalRead(BWBUTTON) == LOW && counter - counterold <= 1000) counter = millis(); while (digitalRead(BWBUTTON) == LOW && counter - counterold <= 1000) counter = millis();
@@ -2507,23 +2507,23 @@ void BWButtonPress() {
void doStereoToggle() { void doStereoToggle() {
if (StereoToggle) { if (StereoToggle) {
if (!screenmute) { if (!screenmute) {
tft.drawCircle(66, 15, 10, BackgroundColor); tft.drawCircle(43, 15, 10, BackgroundColor);
tft.drawCircle(66, 15, 9, BackgroundColor); tft.drawCircle(43, 15, 9, BackgroundColor);
tft.drawCircle(76, 15, 10, BackgroundColor); tft.drawCircle(53, 15, 10, BackgroundColor);
tft.drawCircle(76, 15, 9, BackgroundColor); tft.drawCircle(53, 15, 9, BackgroundColor);
tft.drawCircle(71, 15, 10, SecondaryColor); tft.drawCircle(48, 15, 10, SecondaryColor);
tft.drawCircle(71, 15, 9, SecondaryColor); tft.drawCircle(48, 15, 9, SecondaryColor);
} }
radio.setMono(true); radio.setMono(true);
StereoToggle = false; StereoToggle = false;
} else { } else {
if (!screenmute) { if (!screenmute) {
tft.drawCircle(71, 15, 10, BackgroundColor); tft.drawCircle(48, 15, 10, BackgroundColor);
tft.drawCircle(71, 15, 9, BackgroundColor); tft.drawCircle(48, 15, 9, BackgroundColor);
tft.drawCircle(66, 15, 10, GreyoutColor); tft.drawCircle(43, 15, 10, GreyoutColor);
tft.drawCircle(66, 15, 9, GreyoutColor); tft.drawCircle(43, 15, 9, GreyoutColor);
tft.drawCircle(76, 15, 10, GreyoutColor); tft.drawCircle(53, 15, 10, GreyoutColor);
tft.drawCircle(76, 15, 9, GreyoutColor); tft.drawCircle(53, 15, 9, GreyoutColor);
} }
radio.setMono(false); radio.setMono(false);
Stereostatusold = false; Stereostatusold = false;
@@ -2553,7 +2553,7 @@ void ModeButtonPress() {
} else { } else {
if (!BWtune && !menu) { if (!BWtune && !menu) {
if (!screenmute) { if (!screenmute) {
tft.drawBitmap(92, 4, Speaker, 26, 22, GreyoutColor); tft.drawBitmap(2, 4, Speaker, 26, 22, GreyoutColor);
} }
memorystore = false; memorystore = false;
unsigned long counterold = millis(); unsigned long counterold = millis();
@@ -2761,7 +2761,7 @@ void ButtonPress() {
} }
} }
} else { } else {
if (!screenmute) tft.drawBitmap(92, 4, Speaker, 26, 22, GreyoutColor); if (!screenmute) tft.drawBitmap(2, 4, Speaker, 26, 22, GreyoutColor);
unsigned long counterold = millis(); unsigned long counterold = millis();
unsigned long counter = millis(); unsigned long counter = millis();
while (digitalRead(ROTARY_BUTTON) == LOW && counter - counterold <= 1000) counter = millis(); while (digitalRead(ROTARY_BUTTON) == LOW && counter - counterold <= 1000) counter = millis();
@@ -3102,20 +3102,20 @@ void DoMemoryPosTune() {
StereoToggle = presets[memorypos].ms; StereoToggle = presets[memorypos].ms;
if (!StereoToggle) { if (!StereoToggle) {
Stereostatusold = false; Stereostatusold = false;
tft.drawCircle(66, 15, 10, BackgroundColor); tft.drawCircle(43, 15, 10, BackgroundColor);
tft.drawCircle(66, 15, 9, BackgroundColor); tft.drawCircle(43, 15, 9, BackgroundColor);
tft.drawCircle(76, 15, 10, BackgroundColor); tft.drawCircle(53, 15, 10, BackgroundColor);
tft.drawCircle(76, 15, 9, BackgroundColor); tft.drawCircle(53, 15, 9, BackgroundColor);
tft.drawCircle(71, 15, 10, SecondaryColor); tft.drawCircle(48, 15, 10, SecondaryColor);
tft.drawCircle(71, 15, 9, SecondaryColor); tft.drawCircle(48, 15, 9, SecondaryColor);
} else { } else {
Stereostatusold = false; Stereostatusold = false;
tft.drawCircle(71, 15, 10, BackgroundColor); tft.drawCircle(48, 15, 10, BackgroundColor);
tft.drawCircle(71, 15, 9, BackgroundColor); tft.drawCircle(48, 15, 9, BackgroundColor);
tft.drawCircle(66, 15, 10, GreyoutColor); tft.drawCircle(43, 15, 10, GreyoutColor);
tft.drawCircle(66, 15, 9, GreyoutColor); tft.drawCircle(43, 15, 9, GreyoutColor);
tft.drawCircle(76, 15, 10, GreyoutColor); tft.drawCircle(53, 15, 10, GreyoutColor);
tft.drawCircle(76, 15, 9, GreyoutColor); tft.drawCircle(53, 15, 9, GreyoutColor);
} }
} }
@@ -3421,9 +3421,9 @@ void ShowRDSLogo(bool RDSstatus) {
if (!screenmute) { if (!screenmute) {
if (RDSstatus != RDSstatusold) { if (RDSstatus != RDSstatusold) {
if (RDSstatus) { if (RDSstatus) {
tft.drawBitmap(122, 5, RDSLogo, 35, 22, RDSColor); tft.drawBitmap(70, 5, RDSLogo, 35, 22, RDSColor);
} else { } else {
tft.drawBitmap(122, 5, RDSLogo, 35, 22, GreyoutColor); tft.drawBitmap(70, 5, RDSLogo, 35, 22, GreyoutColor);
} }
} }
RDSstatusold = RDSstatus; RDSstatusold = RDSstatus;
@@ -3435,16 +3435,16 @@ void ShowStereoStatus() {
if (band < BAND_GAP) Stereostatus = radio.getStereoStatus(); else Stereostatus = false; if (band < BAND_GAP) Stereostatus = radio.getStereoStatus(); else Stereostatus = false;
if (Stereostatus != Stereostatusold) { if (Stereostatus != Stereostatusold) {
if (Stereostatus && !screenmute) { if (Stereostatus && !screenmute) {
tft.drawCircle(66, 15, 10, StereoColor); tft.drawCircle(43, 15, 10, StereoColor);
tft.drawCircle(66, 15, 9, StereoColor); tft.drawCircle(43, 15, 9, StereoColor);
tft.drawCircle(76, 15, 10, StereoColor); tft.drawCircle(53, 15, 10, StereoColor);
tft.drawCircle(76, 15, 9, StereoColor); tft.drawCircle(53, 15, 9, StereoColor);
} else { } else {
if (!screenmute) { if (!screenmute) {
tft.drawCircle(66, 15, 10, GreyoutColor); tft.drawCircle(43, 15, 10, GreyoutColor);
tft.drawCircle(66, 15, 9, GreyoutColor); tft.drawCircle(43, 15, 9, GreyoutColor);
tft.drawCircle(76, 15, 10, GreyoutColor); tft.drawCircle(53, 15, 10, GreyoutColor);
tft.drawCircle(76, 15, 9, GreyoutColor); tft.drawCircle(53, 15, 9, GreyoutColor);
} }
} }
Stereostatusold = Stereostatus; Stereostatusold = Stereostatus;
@@ -3460,9 +3460,9 @@ void ShowOffset() {
return; return;
} }
int baseX = 1; // Left boundary int baseX = 108; // Left boundary
int baseY = 16; // Top boundary int baseY = 16; // Top boundary
int width = 51; // Max width int width = 52; // Max width
int height = 13; // Max height int height = 13; // Max height
int centerX = baseX + width / 2; // Center dot X int centerX = baseX + width / 2; // Center dot X
@@ -3673,7 +3673,7 @@ void doSquelch() {
if (SQ || BWreset) { if (SQ || BWreset) {
if (!seek) radio.setUnMute(); if (!seek) radio.setUnMute();
if (!screenmute && !seek) { if (!screenmute && !seek) {
tft.drawBitmap(92, 4, Speaker, 26, 22, GreyoutColor); tft.drawBitmap(2, 4, Speaker, 26, 22, GreyoutColor);
} }
autosquelchtimer = millis(); autosquelchtimer = millis();
SQ = false; SQ = false;
@@ -3682,7 +3682,7 @@ void doSquelch() {
if ((!SQ || BWreset) && (millis() >= autosquelchtimer + 1000)) { if ((!SQ || BWreset) && (millis() >= autosquelchtimer + 1000)) {
radio.setMute(); radio.setMute();
if (!screenmute && !seek) { if (!screenmute && !seek) {
tft.drawBitmap(92, 4, Speaker, 26, 22, PrimaryColor); tft.drawBitmap(2, 4, Speaker, 26, 22, PrimaryColor);
} }
autosquelchtimer = millis(); autosquelchtimer = millis();
SQ = true; SQ = true;
@@ -3692,13 +3692,13 @@ void doSquelch() {
if ((USN < amscansens * 30) && (OStatus < 2 && OStatus > -2) && (!scandxmode || (scandxmode && !scanmute))) { if ((USN < amscansens * 30) && (OStatus < 2 && OStatus > -2) && (!scandxmode || (scandxmode && !scanmute))) {
if (!seek) radio.setUnMute(); if (!seek) radio.setUnMute();
if (!screenmute && !seek) { if (!screenmute && !seek) {
tft.drawBitmap(92, 4, Speaker, 26, 22, GreyoutColor); tft.drawBitmap(2, 4, Speaker, 26, 22, GreyoutColor);
} }
SQ = false; SQ = false;
} else { } else {
radio.setMute(); radio.setMute();
if (!screenmute && !seek) { if (!screenmute && !seek) {
tft.drawBitmap(92, 4, Speaker, 26, 22, PrimaryColor); tft.drawBitmap(2, 4, Speaker, 26, 22, PrimaryColor);
} }
SQ = true; SQ = true;
} }
@@ -3732,13 +3732,13 @@ void doSquelch() {
if (Squelch < SStatus || Squelch == -100 || Squelch == 0) { if (Squelch < SStatus || Squelch == -100 || Squelch == 0) {
if (!seek) radio.setUnMute(); if (!seek) radio.setUnMute();
if (!screenmute && !seek) { if (!screenmute && !seek) {
tft.drawBitmap(92, 4, Speaker, 26, 22, GreyoutColor); tft.drawBitmap(2, 4, Speaker, 26, 22, GreyoutColor);
} }
SQ = false; SQ = false;
} else { } else {
radio.setMute(); radio.setMute();
if (!screenmute && !seek) { if (!screenmute && !seek) {
tft.drawBitmap(92, 4, Speaker, 26, 22, PrimaryColor); tft.drawBitmap(2, 4, Speaker, 26, 22, PrimaryColor);
} }
SQ = true; SQ = true;
} }
@@ -3746,13 +3746,13 @@ void doSquelch() {
if (Stereostatus) { if (Stereostatus) {
radio.setUnMute(); radio.setUnMute();
if (!screenmute && !seek) { if (!screenmute && !seek) {
tft.drawBitmap(92, 4, Speaker, 26, 22, GreyoutColor); tft.drawBitmap(2, 4, Speaker, 26, 22, GreyoutColor);
} }
SQ = false; SQ = false;
} else { } else {
radio.setMute(); radio.setMute();
if (!screenmute && !seek) { if (!screenmute && !seek) {
tft.drawBitmap(92, 4, Speaker, 26, 22, PrimaryColor); tft.drawBitmap(2, 4, Speaker, 26, 22, PrimaryColor);
} }
SQ = true; SQ = true;
} }
@@ -3781,13 +3781,13 @@ void doSquelch() {
if (Squelch < SStatus || Squelch == -100 || Squelch == 0) { if (Squelch < SStatus || Squelch == -100 || Squelch == 0) {
if (!seek) radio.setUnMute(); if (!seek) radio.setUnMute();
if (!screenmute && !seek) { if (!screenmute && !seek) {
tft.drawBitmap(92, 4, Speaker, 26, 22, GreyoutColor); tft.drawBitmap(2, 4, Speaker, 26, 22, GreyoutColor);
} }
SQ = false; SQ = false;
} else { } else {
radio.setMute(); radio.setMute();
if (!screenmute && !seek) { if (!screenmute && !seek) {
tft.drawBitmap(92, 4, Speaker, 26, 22, PrimaryColor); tft.drawBitmap(2, 4, Speaker, 26, 22, PrimaryColor);
} }
SQ = true; SQ = true;
} }
@@ -3795,13 +3795,13 @@ void doSquelch() {
if (Stereostatus) { if (Stereostatus) {
if (!seek) radio.setUnMute(); if (!seek) radio.setUnMute();
if (!screenmute && !seek) { if (!screenmute && !seek) {
tft.drawBitmap(92, 4, Speaker, 26, 22, GreyoutColor); tft.drawBitmap(2, 4, Speaker, 26, 22, GreyoutColor);
} }
SQ = false; SQ = false;
} else { } else {
radio.setMute(); radio.setMute();
if (!screenmute && !seek) { if (!screenmute && !seek) {
tft.drawBitmap(92, 4, Speaker, 26, 22, PrimaryColor); tft.drawBitmap(2, 4, Speaker, 26, 22, PrimaryColor);
} }
SQ = true; SQ = true;
} }
@@ -4404,12 +4404,12 @@ void EdgeBeeper() {
if (radio.mute) { if (radio.mute) {
radio.setMute(); radio.setMute();
if (!screenmute) { if (!screenmute) {
tft.drawBitmap(92, 4, Speaker, 26, 22, PrimaryColor); tft.drawBitmap(2, 4, Speaker, 26, 22, PrimaryColor);
} }
} else { } else {
radio.setUnMute(); radio.setUnMute();
if (!screenmute) { if (!screenmute) {
tft.drawBitmap(92, 4, Speaker, 26, 22, GreyoutColor); tft.drawBitmap(2, 4, Speaker, 26, 22, GreyoutColor);
} }
} }
} }
@@ -4426,7 +4426,7 @@ void Seek(bool mode) {
} }
if (!screenmute) { if (!screenmute) {
tft.drawBitmap(92, 4, Speaker, 26, 22, PrimaryColor); tft.drawBitmap(2, 4, Speaker, 26, 22, PrimaryColor);
} }
if (!mode) TuneDown(); else TuneUp(); if (!mode) TuneDown(); else TuneUp();
delay(50); delay(50);
@@ -4442,7 +4442,7 @@ void Seek(bool mode) {
seek = false; seek = false;
radio.setUnMute(); radio.setUnMute();
if (!screenmute) { if (!screenmute) {
tft.drawBitmap(92, 4, Speaker, 26, 22, GreyoutColor); tft.drawBitmap(2, 4, Speaker, 26, 22, GreyoutColor);
} }
store = true; store = true;
} else { } else {
@@ -4456,7 +4456,7 @@ void Seek(bool mode) {
seek = false; seek = false;
radio.setUnMute(); radio.setUnMute();
if (!screenmute) { if (!screenmute) {
tft.drawBitmap(92, 4, Speaker, 26, 22, GreyoutColor); tft.drawBitmap(2, 4, Speaker, 26, 22, GreyoutColor);
} }
store = true; store = true;
} else { } else {
@@ -4830,7 +4830,7 @@ void cancelDXScan() {
scandxmode = false; scandxmode = false;
if (scanmute) { if (scanmute) {
radio.setUnMute(); radio.setUnMute();
tft.drawBitmap(92, 4, Speaker, 26, 22, GreyoutColor); tft.drawBitmap(2, 4, Speaker, 26, 22, GreyoutColor);
if (!flashing) { if (!flashing) {
tft.fillRoundRect(2, 80, 40, 18, 2, SecondaryColor); tft.fillRoundRect(2, 80, 40, 18, 2, SecondaryColor);
@@ -4995,7 +4995,7 @@ void startFMDXScan() {
} }
if (scanmute) { if (scanmute) {
radio.setMute(); radio.setMute();
tft.drawBitmap(92, 4, Speaker, 26, 22, PrimaryColor); tft.drawBitmap(2, 4, Speaker, 26, 22, PrimaryColor);
SQ = true; SQ = true;
Squelchold = -2; Squelchold = -2;
} }