diff --git a/TEF6686_ESP32.ino b/TEF6686_ESP32.ino index 7b1bdc3..490dd34 100644 --- a/TEF6686_ESP32.ino +++ b/TEF6686_ESP32.ino @@ -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(); + } + } +} diff --git a/src/touch.cpp b/src/touch.cpp index 14d6bd6..164200b 100644 --- a/src/touch.cpp +++ b/src/touch.cpp @@ -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 } } diff --git a/src/touch.h b/src/touch.h index bdb1b01..abab579 100644 --- a/src/touch.h +++ b/src/touch.h @@ -41,4 +41,5 @@ extern void KeyUp(); extern void ButtonPress(); extern void DoMenu(); extern void ModeButtonPress(); +extern void toggleiMSEQ(); #endif \ No newline at end of file