UI tweaks pt 2

This commit is contained in:
MCelliotG
2025-02-06 04:57:19 +02:00
committed by GitHub
parent 07f3a89dfd
commit 84c5107749

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(2, 4, Speaker, 26, 22, PrimaryColor); if (!screenmute) tft.drawBitmap(253, 140, 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(2, 4, Speaker, 26, 22, GreyoutColor); if (!screenmute) tft.drawBitmap(253, 140, 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(2, 4, Speaker, 26, 22, PrimaryColor); tft.drawBitmap(253, 140, 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(2, 4, Speaker, 26, 22, GreyoutColor); tft.drawBitmap(253, 140, Speaker, 26, 22, GreyoutColor);
} }
findMemoryAF = false; findMemoryAF = false;
} else { } else {
@@ -2350,7 +2350,7 @@ void SelectBand() {
} }
if (band > BAND_GAP) { if (band > BAND_GAP) {
if (!screenmute) tft.drawBitmap(2, 4, Speaker, 26, 22, GreyoutColor); if (!screenmute) tft.drawBitmap(253, 140, 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;
@@ -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(2, 4, Speaker, 26, 22, GreyoutColor); if (!screenmute) tft.drawBitmap(253, 140, 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();
@@ -2553,7 +2553,7 @@ void ModeButtonPress() {
} else { } else {
if (!BWtune && !menu) { if (!BWtune && !menu) {
if (!screenmute) { if (!screenmute) {
tft.drawBitmap(2, 4, Speaker, 26, 22, GreyoutColor); tft.drawBitmap(253, 140, 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(2, 4, Speaker, 26, 22, GreyoutColor); if (!screenmute) tft.drawBitmap(253, 140, 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();
@@ -3460,17 +3460,17 @@ void ShowOffset() {
return; return;
} }
int baseX = 108; // Left boundary int baseX = 13; // Left boundary
int baseY = 16; // Top boundary int baseY = 2; // Top boundary
int width = 52; // Max width int width = 4; // Max width
int height = 13; // Max height int height = 26; // Max height
int centerX = baseX + width / 2; // Center dot X int centerX = baseX + width / 2; // Center dot X
int centerY = baseY + height / 2; // Center dot Y int centerY = baseY + height / 2; // Center dot Y
// **Move arrows 3px further from the dot** // **Move arrows 3px further from the dot**
int arrowGap = 3; // Space between dot and arrows int arrowGap = 3; // Space between dot and arrows
int arrowWidth = 18; // Arrow stretch size int arrowWidth = 9; // Arrow stretch size
int leftArrowBaseX = centerX - arrowWidth - arrowGap; // Shift left arrow further left int leftArrowBaseX = centerX - arrowWidth - arrowGap; // Shift left arrow further left
int rightArrowBaseX = centerX + arrowWidth + arrowGap; // Shift right arrow further right int rightArrowBaseX = centerX + arrowWidth + arrowGap; // Shift right arrow further right
@@ -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(2, 4, Speaker, 26, 22, GreyoutColor); tft.drawBitmap(253, 140, 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(2, 4, Speaker, 26, 22, PrimaryColor); tft.drawBitmap(253, 140, 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(2, 4, Speaker, 26, 22, GreyoutColor); tft.drawBitmap(253, 140, Speaker, 26, 22, GreyoutColor);
} }
SQ = false; SQ = false;
} else { } else {
radio.setMute(); radio.setMute();
if (!screenmute && !seek) { if (!screenmute && !seek) {
tft.drawBitmap(2, 4, Speaker, 26, 22, PrimaryColor); tft.drawBitmap(253, 140, 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(2, 4, Speaker, 26, 22, GreyoutColor); tft.drawBitmap(253, 140, Speaker, 26, 22, GreyoutColor);
} }
SQ = false; SQ = false;
} else { } else {
radio.setMute(); radio.setMute();
if (!screenmute && !seek) { if (!screenmute && !seek) {
tft.drawBitmap(2, 4, Speaker, 26, 22, PrimaryColor); tft.drawBitmap(253, 140, 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(2, 4, Speaker, 26, 22, GreyoutColor); tft.drawBitmap(253, 140, Speaker, 26, 22, GreyoutColor);
} }
SQ = false; SQ = false;
} else { } else {
radio.setMute(); radio.setMute();
if (!screenmute && !seek) { if (!screenmute && !seek) {
tft.drawBitmap(2, 4, Speaker, 26, 22, PrimaryColor); tft.drawBitmap(253, 140, 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(2, 4, Speaker, 26, 22, GreyoutColor); tft.drawBitmap(253, 140, Speaker, 26, 22, GreyoutColor);
} }
SQ = false; SQ = false;
} else { } else {
radio.setMute(); radio.setMute();
if (!screenmute && !seek) { if (!screenmute && !seek) {
tft.drawBitmap(2, 4, Speaker, 26, 22, PrimaryColor); tft.drawBitmap(253, 140, 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(2, 4, Speaker, 26, 22, GreyoutColor); tft.drawBitmap(253, 140, Speaker, 26, 22, GreyoutColor);
} }
SQ = false; SQ = false;
} else { } else {
radio.setMute(); radio.setMute();
if (!screenmute && !seek) { if (!screenmute && !seek) {
tft.drawBitmap(2, 4, Speaker, 26, 22, PrimaryColor); tft.drawBitmap(253, 140, 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(2, 4, Speaker, 26, 22, PrimaryColor); tft.drawBitmap(253, 140, Speaker, 26, 22, PrimaryColor);
} }
} else { } else {
radio.setUnMute(); radio.setUnMute();
if (!screenmute) { if (!screenmute) {
tft.drawBitmap(2, 4, Speaker, 26, 22, GreyoutColor); tft.drawBitmap(253, 140, Speaker, 26, 22, GreyoutColor);
} }
} }
} }
@@ -4426,7 +4426,7 @@ void Seek(bool mode) {
} }
if (!screenmute) { if (!screenmute) {
tft.drawBitmap(2, 4, Speaker, 26, 22, PrimaryColor); tft.drawBitmap(253, 140, 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(2, 4, Speaker, 26, 22, GreyoutColor); tft.drawBitmap(253, 140, 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(2, 4, Speaker, 26, 22, GreyoutColor); tft.drawBitmap(253, 140, 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(2, 4, Speaker, 26, 22, GreyoutColor); tft.drawBitmap(253, 140, 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(2, 4, Speaker, 26, 22, PrimaryColor); tft.drawBitmap(253, 140, Speaker, 26, 22, PrimaryColor);
SQ = true; SQ = true;
Squelchold = -2; Squelchold = -2;
} }