Added iMQ/EQ toggle via touchscreen

This commit is contained in:
Sjef Verhoeven PE5PVB
2025-01-03 12:11:25 +01:00
parent 0c657f02c1
commit 39c67cef78
3 changed files with 56 additions and 49 deletions

View File

@@ -2723,55 +2723,7 @@ void ButtonPress() {
}
}
} else {
if (band < BAND_GAP) {
if (iMSEQ == 0) iMSEQ = 1;
if (iMSEQ == 4) {
iMSset = 0;
EQset = 0;
updateiMS();
updateEQ();
iMSEQ = 0;
}
if (iMSEQ == 3) {
iMSset = 1;
EQset = 0;
updateiMS();
updateEQ();
iMSEQ = 4;
}
if (iMSEQ == 2) {
iMSset = 0;
EQset = 1;
updateiMS();
updateEQ();
iMSEQ = 3;
}
if (iMSEQ == 1) {
iMSset = 1;
EQset = 1;
updateiMS();
updateEQ();
iMSEQ = 2;
}
EEPROM.writeByte(EE_BYTE_IMSSET, iMSset);
EEPROM.writeByte(EE_BYTE_EQSET, EQset);
EEPROM.commit();
if (XDRGTKUSB || XDRGTKTCP) DataPrint("G" + String(!EQset) + String(!iMSset) + "\n");
} else {
if (band == BAND_SW && tunemode != TUNE_MEM) {
nowToggleSWMIBand = !nowToggleSWMIBand;
tunemode = TUNE_MAN;
EEPROM.writeByte(EE_BYTE_BANDAUTOSW, nowToggleSWMIBand);
EEPROM.commit();
if (!screenmute) {
tftPrint(0, "AUTO", 22, 60, BackgroundColor, BackgroundColor, 16);
tftPrint(0, "BAND", 22, 60, BackgroundColor, BackgroundColor, 16);
}
doTuneMode();
ShowTuneMode();
}
}
toggleiMSEQ();
}
}
if (screensaverset) {
@@ -5269,3 +5221,55 @@ void NumpadProcess(int num) {
}
}
}
void toggleiMSEQ() {
if (band < BAND_GAP) {
if (iMSEQ == 0) iMSEQ = 1;
if (iMSEQ == 4) {
iMSset = 0;
EQset = 0;
updateiMS();
updateEQ();
iMSEQ = 0;
}
if (iMSEQ == 3) {
iMSset = 1;
EQset = 0;
updateiMS();
updateEQ();
iMSEQ = 4;
}
if (iMSEQ == 2) {
iMSset = 0;
EQset = 1;
updateiMS();
updateEQ();
iMSEQ = 3;
}
if (iMSEQ == 1) {
iMSset = 1;
EQset = 1;
updateiMS();
updateEQ();
iMSEQ = 2;
}
EEPROM.writeByte(EE_BYTE_IMSSET, iMSset);
EEPROM.writeByte(EE_BYTE_EQSET, EQset);
EEPROM.commit();
if (XDRGTKUSB || XDRGTKTCP) DataPrint("G" + String(!EQset) + String(!iMSset) + "\n");
} else {
if (band == BAND_SW && tunemode != TUNE_MEM) {
nowToggleSWMIBand = !nowToggleSWMIBand;
tunemode = TUNE_MAN;
EEPROM.writeByte(EE_BYTE_BANDAUTOSW, nowToggleSWMIBand);
EEPROM.commit();
if (!screenmute) {
tftPrint(0, "AUTO", 22, 60, BackgroundColor, BackgroundColor, 16);
tftPrint(0, "BAND", 22, 60, BackgroundColor, BackgroundColor, 16);
}
doTuneMode();
ShowTuneMode();
}
}
}

View File

@@ -165,6 +165,8 @@ void doTouchEvent(uint16_t x, uint16_t y) {
} else if (x > 0 && x < 30 && y > 25 && y < 90) {
doTuneMode(); // Toggle tune mode
return;
} else if (x > 250 && x < 320 && y > 50 && y < 80) {
toggleiMSEQ(); // Toggle iMQ/EQ
}
}

View File

@@ -41,4 +41,5 @@ extern void KeyUp();
extern void ButtonPress();
extern void DoMenu();
extern void ModeButtonPress();
extern void toggleiMSEQ();
#endif