From 1af1d485f2591dd6a124adfb0d6fb27850a0cf98 Mon Sep 17 00:00:00 2001 From: Leon Date: Tue, 30 Apr 2024 23:59:19 +0800 Subject: [PATCH 01/12] IO Expander I2C OK --- TEF6686_ESP32.ino | 44 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/TEF6686_ESP32.ino b/TEF6686_ESP32.ino index 2baeddb..d710684 100644 --- a/TEF6686_ESP32.ino +++ b/TEF6686_ESP32.ino @@ -35,8 +35,20 @@ #define SMETERPIN 27 // #define CHINA_PORTABLE // uncomment for China Portable build (Simplified Chinese) +#define DEEPELEC_DP_666 // uncomment for DEEPELEC Portable DP-666 build (Simplified Chinese) #define DYNAMIC_SPI_SPEED // uncomment to enable dynamic SPI Speed https://github.com/ohmytime/TFT_eSPI_DynamicSpeed +#ifdef DEEPELEC_DP_666 +#include "ExtensionIOXL9555.hpp" +#endif + +#ifdef DEEPELEC_DP_666 +#define RTP_IRQ 33 +#define EXT_IO_SDA 32 +#define EXT_IO_SCL 14 +ExtensionIOXL9555 extIO; +#endif + #ifdef ARS TFT_eSPI tft = TFT_eSPI(320, 240); #else @@ -137,7 +149,7 @@ byte BWset; byte BWsetAM; byte BWsetFM; byte charwidth = 8; -#ifdef CHINA_PORTABLE +#if defined(CHINA_PORTABLE) || defined(DEEPELEC_DP_666) byte hardwaremodel = PORTABLE_ILI9341; #else byte hardwaremodel = BASE_ILI9341; @@ -585,6 +597,19 @@ void setup() { attachInterrupt(digitalPinToInterrupt(ROTARY_PIN_A), read_encoder, CHANGE); attachInterrupt(digitalPinToInterrupt(ROTARY_PIN_B), read_encoder, CHANGE); +#ifdef DEEPELEC_DP_666 + bool extIO_dect = false; + // Device address 0x20~0x27 + if (extIO.begin(Wire1, XL9555_SLAVE_ADDRESS0, EXT_IO_SDA, EXT_IO_SCL)) { + extIO_dect = true; + pinMode(RTP_IRQ, INPUT_PULLUP); + // Set PORT0 as input,mask = 0xFF = all pin input + extIO.configPort(ExtensionIOXL9555::PORT0, 0xFF); + // Set PORT1 as input,mask = 0xFF = all pin input + extIO.configPort(ExtensionIOXL9555::PORT1, 0xFF); + } +#endif + tft.setSwapBytes(true); tft.fillScreen(BackgroundColor); @@ -679,6 +704,13 @@ void setup() { tftPrint(0, myLanguage[language][8], 160, 3, PrimaryColor, PrimaryColorSmooth, 28); tftPrint(0, "Software " + String(VERSION), 160, 152, PrimaryColor, PrimaryColorSmooth, 16); +#ifdef DEEPELEC_DP_666 + if (extIO_dect) + tftPrint(-1, "EXT_IO OK!", 240, 152, PrimaryColor, PrimaryColorSmooth, 16); + else + tftPrint(-1, "EXT_IO ERR!", 240, 152, PrimaryColor, PrimaryColorSmooth, 16); +#endif + tft.fillRect(120, 230, 16, 6, GreyoutColor); tft.fillRect(152, 230, 16, 6, GreyoutColor); tft.fillRect(184, 230, 16, 6, GreyoutColor); @@ -1071,6 +1103,12 @@ void loop() { if (!screenmute && !afscreen) BWButtonPress(); } +#ifdef DEEPELEC_DP_666 + if (digitalRead(RTP_IRQ) == LOW) { + + } +#endif + if (screensaverset) { if (screensaver_IRQ) { @@ -3739,7 +3777,11 @@ void DefaultSettings(byte userhardwaremodel) { EEPROM.writeByte(EE_BYTE_SHOWRDSERRORS, 1); EEPROM.writeByte(EE_BYTE_TEF, 0); if (userhardwaremodel == BASE_ILI9341) EEPROM.writeByte(EE_BYTE_DISPLAYFLIP, 0); else EEPROM.writeByte(EE_BYTE_DISPLAYFLIP, 1); +#ifdef DEEPELEC_DP_666 + EEPROM.writeByte(EE_BYTE_ROTARYMODE, 1); +#else EEPROM.writeByte(EE_BYTE_ROTARYMODE, 0); +#endif EEPROM.writeByte(EE_BYTE_STEPSIZE, 0); EEPROM.writeByte(EE_BYTE_TUNEMODE, 0); EEPROM.writeByte(EE_BYTE_OPTENC, 0); From 4bbf28f17cb60527ef88b4f96d368418eff48445 Mon Sep 17 00:00:00 2001 From: Leon Date: Sun, 5 May 2024 23:42:53 +0800 Subject: [PATCH 02/12] DEEPELEC_DP_666 -> config.h --- TEF6686_ESP32.ino | 2 -- src/config.h | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/TEF6686_ESP32.ino b/TEF6686_ESP32.ino index b022f6e..cd033e9 100644 --- a/TEF6686_ESP32.ino +++ b/TEF6686_ESP32.ino @@ -35,8 +35,6 @@ #define STANDBYLED 19 #define SMETERPIN 27 - -#define DEEPELEC_DP_666 // uncomment for DEEPELEC Portable DP-666 build (Simplified Chinese) #define DYNAMIC_SPI_SPEED // uncomment to enable dynamic SPI Speed https://github.com/ohmytime/TFT_eSPI_DynamicSpeed #ifdef DEEPELEC_DP_666 diff --git a/src/config.h b/src/config.h index 53da484..3cbd2c5 100644 --- a/src/config.h +++ b/src/config.h @@ -5,5 +5,6 @@ // #define HAS_AIR_BAND // uncomment to enable Air Band(Make sure you have Air Band extend board) #define CHINA_PORTABLE // uncomment for China Portable build (Simplified Chinese) +#define DEEPELEC_DP_666 // uncomment for DEEPELEC Portable DP-666 build (Simplified Chinese) #endif \ No newline at end of file From 466a089f008edc8b63f1d5070cf6af32ef5d443d Mon Sep 17 00:00:00 2001 From: Leon Date: Mon, 6 May 2024 11:35:23 +0800 Subject: [PATCH 03/12] ShowNumInput --- TEF6686_ESP32.ino | 8 +++++++- src/config.h | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/TEF6686_ESP32.ino b/TEF6686_ESP32.ino index cd033e9..01c0a84 100644 --- a/TEF6686_ESP32.ino +++ b/TEF6686_ESP32.ino @@ -1116,7 +1116,9 @@ void loop() { #ifdef DEEPELEC_DP_666 if (digitalRead(RTP_IRQ) == LOW) { - + // 读出 PORT0 PORT1 + if (!screenmute && !menu && !advancedRDS && !afscreen) + ShowNumInput(); } #endif @@ -4410,3 +4412,7 @@ void setAutoSpeedSPI() { default: tft.setSPISpeed(30); break; } } + +void ShowNumInput() { + +} diff --git a/src/config.h b/src/config.h index 3cbd2c5..da079ba 100644 --- a/src/config.h +++ b/src/config.h @@ -4,7 +4,7 @@ #include // #define HAS_AIR_BAND // uncomment to enable Air Band(Make sure you have Air Band extend board) -#define CHINA_PORTABLE // uncomment for China Portable build (Simplified Chinese) +// #define CHINA_PORTABLE // uncomment for China Portable build (Simplified Chinese) #define DEEPELEC_DP_666 // uncomment for DEEPELEC Portable DP-666 build (Simplified Chinese) #endif \ No newline at end of file From 83c7b6dfd1604f7016265871a1a74c1ada499755 Mon Sep 17 00:00:00 2001 From: Leon Date: Tue, 7 May 2024 20:42:40 +0800 Subject: [PATCH 04/12] Number input test ok --- TEF6686_ESP32.ino | 42 ++++++++++++++++++++++++++++++++++++++---- 1 file changed, 38 insertions(+), 4 deletions(-) diff --git a/TEF6686_ESP32.ino b/TEF6686_ESP32.ino index 01c0a84..0668a3f 100644 --- a/TEF6686_ESP32.ino +++ b/TEF6686_ESP32.ino @@ -1116,9 +1116,11 @@ void loop() { #ifdef DEEPELEC_DP_666 if (digitalRead(RTP_IRQ) == LOW) { - // 读出 PORT0 PORT1 + int16_t temp; + temp = extIO.readPort(ExtensionIOXL9555::PORT1) & 0xFF; + temp = (temp << 8) | (extIO.readPort(ExtensionIOXL9555::PORT0) & 0xFF); if (!screenmute && !menu && !advancedRDS && !afscreen) - ShowNumInput(); + ShowNumInput(temp); } #endif @@ -4413,6 +4415,38 @@ void setAutoSpeedSPI() { } } -void ShowNumInput() { - +#ifdef DEEPELEC_DP_666 +byte keyval[16] = { + 2, 3, 127, 5, 6, 0, 9, 13, 8, 7, 4, 1, 0, 0, 0, 0 +}; +void ShowNumInput(int16_t port) { + int cnt = 0; + unsigned int key; + for (int i = 0; i < 16; i++) { + if ((port & 0x01) == 0) { + key = keyval[i]; + cnt ++; + } + port >>= 1; + } + if (cnt == 1) { + switch (freqfont) { + case 0: FrequencySprite.loadFont(FREQFONT0); break; + case 1: FrequencySprite.loadFont(FREQFONT1); break; + case 2: FrequencySprite.loadFont(FREQFONT2); break; + case 3: FrequencySprite.loadFont(FREQFONT3); break; + case 4: FrequencySprite.loadFont(FREQFONT4); break; + case 5: FrequencySprite.loadFont(FREQFONT5); break; + } + + FrequencySprite.setTextDatum(TR_DATUM); + + FrequencySprite.fillSprite(BackgroundColor); + FrequencySprite.setTextColor(FreqColor, FreqColorSmooth, false); + FrequencySprite.drawString(String(key) + " ", 218, -6); + FrequencySprite.pushSprite(46, 46); + + FrequencySprite.unloadFont(); + } } +#endif From 6e6fb702485e2c512237f37b633d64c2a6a7646c Mon Sep 17 00:00:00 2001 From: Leon Date: Mon, 15 Jul 2024 11:16:25 +0800 Subject: [PATCH 05/12] Modify I2C and IRQ PINs --- TEF6686_ESP32.ino | 71 +++++++++++++++++++++++------------------------ src/config.h | 2 +- 2 files changed, 35 insertions(+), 38 deletions(-) diff --git a/TEF6686_ESP32.ino b/TEF6686_ESP32.ino index 5722d55..2ad6edd 100644 --- a/TEF6686_ESP32.ino +++ b/TEF6686_ESP32.ino @@ -37,15 +37,8 @@ #define DYNAMIC_SPI_SPEED // uncomment to enable dynamic SPI Speed https://github.com/ohmytime/TFT_eSPI_DynamicSpeed -#ifdef DEEPELEC_DP_666 -#include "ExtensionIOXL9555.hpp" -#endif - -#ifdef DEEPELEC_DP_666 -#define RTP_IRQ 33 -#define EXT_IO_SDA 32 -#define EXT_IO_SCL 14 -ExtensionIOXL9555 extIO; +#ifdef DEEPELEC_DP_66X +#define EXT_IRQ 14 #endif #ifdef ARS @@ -156,7 +149,7 @@ byte BWset; byte BWsetAM; byte BWsetFM; byte charwidth = 8; -#if defined(CHINA_PORTABLE) || defined(DEEPELEC_DP_666) +#if defined(CHINA_PORTABLE) || defined(DEEPELEC_DP_66X) byte hardwaremodel = PORTABLE_ILI9341; #else byte hardwaremodel = BASE_ILI9341; @@ -627,17 +620,8 @@ void setup() { attachInterrupt(digitalPinToInterrupt(ROTARY_PIN_A), read_encoder, CHANGE); attachInterrupt(digitalPinToInterrupt(ROTARY_PIN_B), read_encoder, CHANGE); -#ifdef DEEPELEC_DP_666 - bool extIO_dect = false; - // Device address 0x20~0x27 - if (extIO.begin(Wire1, XL9555_SLAVE_ADDRESS0, EXT_IO_SDA, EXT_IO_SCL)) { - extIO_dect = true; - pinMode(RTP_IRQ, INPUT_PULLUP); - // Set PORT0 as input,mask = 0xFF = all pin input - extIO.configPort(ExtensionIOXL9555::PORT0, 0xFF); - // Set PORT1 as input,mask = 0xFF = all pin input - extIO.configPort(ExtensionIOXL9555::PORT1, 0xFF); - } +#ifdef DEEPELEC_DP_66X + pinMode(EXT_IRQ, INPUT_PULLUP); #endif tft.setSwapBytes(true); @@ -733,13 +717,6 @@ void setup() { tftPrint(0, myLanguage[language][8], 160, 3, PrimaryColor, PrimaryColorSmooth, 28); tftPrint(0, "Software " + String(VERSION), 160, 152, PrimaryColor, PrimaryColorSmooth, 16); -#ifdef DEEPELEC_DP_666 - if (extIO_dect) - tftPrint(-1, "EXT_IO OK!", 240, 152, PrimaryColor, PrimaryColorSmooth, 16); - else - tftPrint(-1, "EXT_IO ERR!", 240, 152, PrimaryColor, PrimaryColorSmooth, 16); -#endif - tft.fillRect(120, 230, 16, 6, GreyoutColor); tft.fillRect(152, 230, 16, 6, GreyoutColor); tft.fillRect(184, 230, 16, 6, GreyoutColor); @@ -791,6 +768,20 @@ void setup() { } tftPrint(0, "Patch: v" + String(TEF), 160, 202, ActiveColor, ActiveColorSmooth, 28); +#ifdef DEEPELEC_DP_66X + bool extIO_dect = false; + // Device address 0x20 + // Set PORT0/PORT1 as input + Wire.beginTransmission(0x20); + Wire.write(0x06); + Wire.write(0xFF); + Wire.write(0xFF); + if (Wire.endTransmission() == 0) { + extIO_dect = true; + tftPrint(-1, "HW:DP-666", 240, 152, PrimaryColor, PrimaryColorSmooth, 16); + } +#endif + if (analogRead(BATTERY_PIN) < 200) batterydetect = false; if (wifi) { @@ -1224,13 +1215,19 @@ void loop() { } } -#ifdef DEEPELEC_DP_666 - if (digitalRead(RTP_IRQ) == LOW) { - int16_t temp; - temp = extIO.readPort(ExtensionIOXL9555::PORT1) & 0xFF; - temp = (temp << 8) | (extIO.readPort(ExtensionIOXL9555::PORT0) & 0xFF); - if (!screenmute && !menu && !advancedRDS && !afscreen) - ShowNumInput(temp); +#ifdef DEEPELEC_DP_66X + if (digitalRead(EXT_IRQ) == LOW) { + int16_t temp = 1; + Wire.beginTransmission(0x20); + Wire.write(0x00); + Wire.endTransmission(); + Wire.requestFrom(0x20, 2); + if (Wire.available() == 2) { + temp = Wire.read() & 0xFF; + temp |= (Wire.read() & 0xFF) * 256; + if (!screenmute && !menu && !advancedRDS && !afscreen) + ShowNumInput(temp); + } } #endif @@ -4287,7 +4284,7 @@ void DefaultSettings(byte userhardwaremodel) { EEPROM.writeByte(EE_BYTE_SHOWRDSERRORS, 1); EEPROM.writeByte(EE_BYTE_TEF, 0); if (userhardwaremodel == BASE_ILI9341) EEPROM.writeByte(EE_BYTE_DISPLAYFLIP, 0); else EEPROM.writeByte(EE_BYTE_DISPLAYFLIP, 1); -#ifdef DEEPELEC_DP_666 +#ifdef DEEPELEC_DP_66X EEPROM.writeByte(EE_BYTE_ROTARYMODE, 1); #else EEPROM.writeByte(EE_BYTE_ROTARYMODE, 0); @@ -4691,7 +4688,7 @@ void setAutoSpeedSPI() { } } -#ifdef DEEPELEC_DP_666 +#ifdef DEEPELEC_DP_66X byte keyval[16] = { 2, 3, 127, 5, 6, 0, 9, 13, 8, 7, 4, 1, 0, 0, 0, 0 }; diff --git a/src/config.h b/src/config.h index da079ba..6749a3d 100644 --- a/src/config.h +++ b/src/config.h @@ -5,6 +5,6 @@ // #define HAS_AIR_BAND // uncomment to enable Air Band(Make sure you have Air Band extend board) // #define CHINA_PORTABLE // uncomment for China Portable build (Simplified Chinese) -#define DEEPELEC_DP_666 // uncomment for DEEPELEC Portable DP-666 build (Simplified Chinese) +#define DEEPELEC_DP_66X // uncomment for DEEPELEC Portable DP-66X build (Simplified Chinese) #endif \ No newline at end of file From 94708dec9e15d994744f926d676f2b3542de9142 Mon Sep 17 00:00:00 2001 From: Leon Date: Mon, 5 Aug 2024 15:49:46 +0800 Subject: [PATCH 06/12] XL9555 works OK --- TEF6686_ESP32.ino | 87 +++++++++++++++++++++++++++++------------------ 1 file changed, 53 insertions(+), 34 deletions(-) diff --git a/TEF6686_ESP32.ino b/TEF6686_ESP32.ino index 2ad6edd..ea71024 100644 --- a/TEF6686_ESP32.ino +++ b/TEF6686_ESP32.ino @@ -1217,16 +1217,14 @@ void loop() { #ifdef DEEPELEC_DP_66X if (digitalRead(EXT_IRQ) == LOW) { - int16_t temp = 1; - Wire.beginTransmission(0x20); - Wire.write(0x00); - Wire.endTransmission(); - Wire.requestFrom(0x20, 2); - if (Wire.available() == 2) { - temp = Wire.read() & 0xFF; - temp |= (Wire.read() & 0xFF) * 256; + int num; + num = GetNumInput(); + if (num != -1) + { if (!screenmute && !menu && !advancedRDS && !afscreen) - ShowNumInput(temp); + { + ShowNumInput(num); + } } } #endif @@ -4692,34 +4690,55 @@ void setAutoSpeedSPI() { byte keyval[16] = { 2, 3, 127, 5, 6, 0, 9, 13, 8, 7, 4, 1, 0, 0, 0, 0 }; -void ShowNumInput(int16_t port) { + +int GetNumInput(void) +{ + int16_t temp; int cnt = 0; - unsigned int key; - for (int i = 0; i < 16; i++) { - if ((port & 0x01) == 0) { - key = keyval[i]; - cnt ++; + unsigned int num; + + Wire.beginTransmission(0x20); + Wire.write(0x00); + Wire.endTransmission(); + Wire.requestFrom(0x20, 2); + + if (Wire.available() == 2) + { + temp = Wire.read() & 0xFF; + temp |= (Wire.read() & 0xFF) * 256; + for (int i = 0; i < 16; i++) { + if ((temp & 0x01) == 0) + { + num = keyval[i]; + cnt ++; + } + temp >>= 1; } - port >>= 1; + if (cnt == 1) + return num; } - if (cnt == 1) { - switch (freqfont) { - case 0: FrequencySprite.loadFont(FREQFONT0); break; - case 1: FrequencySprite.loadFont(FREQFONT1); break; - case 2: FrequencySprite.loadFont(FREQFONT2); break; - case 3: FrequencySprite.loadFont(FREQFONT3); break; - case 4: FrequencySprite.loadFont(FREQFONT4); break; - case 5: FrequencySprite.loadFont(FREQFONT5); break; - } - - FrequencySprite.setTextDatum(TR_DATUM); - - FrequencySprite.fillSprite(BackgroundColor); - FrequencySprite.setTextColor(FreqColor, FreqColorSmooth, false); - FrequencySprite.drawString(String(key) + " ", 218, -6); - FrequencySprite.pushSprite(46, 46); - - FrequencySprite.unloadFont(); + + return -1; +} + +void ShowNumInput(int val) +{ + switch (freqfont) { + case 0: FrequencySprite.loadFont(FREQFONT0); break; + case 1: FrequencySprite.loadFont(FREQFONT1); break; + case 2: FrequencySprite.loadFont(FREQFONT2); break; + case 3: FrequencySprite.loadFont(FREQFONT3); break; + case 4: FrequencySprite.loadFont(FREQFONT4); break; + case 5: FrequencySprite.loadFont(FREQFONT5); break; } + + FrequencySprite.setTextDatum(TR_DATUM); + + FrequencySprite.fillSprite(BackgroundColor); + FrequencySprite.setTextColor(FreqColor, FreqColorSmooth, false); + FrequencySprite.drawString(String(val) + " ", 218, -6); + FrequencySprite.pushSprite(46, 46); + + FrequencySprite.unloadFont(); } #endif From 3cf39aaea80a6ac7d05d8ad08db772592ef8972f Mon Sep 17 00:00:00 2001 From: Leon Date: Tue, 6 Aug 2024 18:50:16 +0800 Subject: [PATCH 07/12] Number pad tune freq ok --- TEF6686_ESP32.ino | 103 +++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 97 insertions(+), 6 deletions(-) diff --git a/TEF6686_ESP32.ino b/TEF6686_ESP32.ino index c65f5e4..f6181fa 100644 --- a/TEF6686_ESP32.ino +++ b/TEF6686_ESP32.ino @@ -1231,12 +1231,12 @@ void loop() { #ifdef DEEPELEC_DP_66X if (digitalRead(EXT_IRQ) == LOW) { int num; - num = GetNumInput(); + num = GetNum(); if (num != -1) { if (!screenmute && !menu && !advancedRDS && !afscreen) { - ShowNumInput(num); + NumpadProcess(num); } } } @@ -4813,11 +4813,11 @@ void StoreMemoryPos(uint8_t _pos) { } #ifdef DEEPELEC_DP_66X -byte keyval[16] = { +byte numval[16] = { 2, 3, 127, 5, 6, 0, 9, 13, 8, 7, 4, 1, 0, 0, 0, 0 }; -int GetNumInput(void) +int GetNum(void) { int16_t temp; int cnt = 0; @@ -4835,7 +4835,7 @@ int GetNumInput(void) for (int i = 0; i < 16; i++) { if ((temp & 0x01) == 0) { - num = keyval[i]; + num = numval[i]; cnt ++; } temp >>= 1; @@ -4847,7 +4847,7 @@ int GetNumInput(void) return -1; } -void ShowNumInput(int val) +void ShowNum(int val) { switch (freqfont) { case 0: FrequencySprite.loadFont(FREQFONT0); break; @@ -4867,4 +4867,95 @@ void ShowNumInput(int val) FrequencySprite.unloadFont(); } + +void TuneFreq(int temp) +{ + aftest = true; + aftimer = millis(); + + if (band == BAND_FM) { + while (temp < (LowEdgeSet * 10)) temp = temp*10; + if (temp > (HighEdgeSet * 10)) { + if (edgebeep) EdgeBeeper(); + } else { + frequency = temp; + } + radio.SetFreq(frequency); + } + else if (band == BAND_OIRT) { + while (temp < (LowEdgeOIRTSet * 10)) temp = temp*10; + if (temp > HighEdgeOIRTSet) { + if (edgebeep) EdgeBeeper(); + } else { + frequency_OIRT = temp; + } + radio.SetFreq(frequency_OIRT); + } + else if (band == BAND_LW) { + while (temp < LWLowEdgeSet) temp = temp*10; + if (temp > LWHighEdgeSet) { + if (edgebeep) EdgeBeeper(); + } else { + frequency_AM = temp; + } + radio.SetFreqAM(frequency_AM); + frequency_LW = frequency_AM; + } + else if (band == BAND_MW) { + while (temp < MWLowEdgeSet) temp = temp*10; + if (temp > MWHighEdgeSet) { + if (edgebeep) EdgeBeeper(); + } else { + frequency_AM = temp; + } + radio.SetFreqAM(frequency_AM); + frequency_MW = frequency_AM; + } + else if (band == BAND_SW) { + while (temp < SWLowEdgeSet) temp = temp*10; + if (temp > SWHighEdgeSet) { + if (edgebeep) EdgeBeeper(); + } else { + frequency_AM = temp; + } + radio.SetFreqAM(frequency_AM); + frequency_SW = frequency_AM; + } + + radio.clearRDS(fullsearchrds); + if (RDSSPYUSB) Serial.print("G:\r\nRESET-------\r\n\r\n"); + if (RDSSPYTCP) RemoteClient.print("G:\r\nRESET-------\r\n\r\n"); +} + +void NumpadProcess(int num) +{ + static bool input_mode = false; + static int freq_in = 0; + + if (scandxmode) { + if (num == 127) { // DX + cancelDXScan(); + } + } else { + if (num == 127) { // DX + startFMDXScan(); + } + else if (num == 13) { // Enter + if (freq_in != 0) { + TuneFreq(freq_in); + if (XDRGTKUSB || XDRGTKTCP) { + if (band == BAND_FM) DataPrint("M0\nT" + String(frequency * 10) + "\n"); else if (band == BAND_OIRT) DataPrint("M0\nT" + String(frequency_OIRT * 10) + "\n"); else DataPrint("M1\nT" + String(frequency_AM) + "\n"); + } + ShowFreq(0); + } + freq_in = 0; + } + else { // Num + if (freq_in/10000 == 0) { + freq_in = freq_in*10 + num; + } + ShowNum(freq_in); + } + } +} #endif From a1fa8ae554e2b33698ba6adee0acb9cf14919af7 Mon Sep 17 00:00:00 2001 From: Leon Date: Thu, 22 Aug 2024 09:29:11 +0800 Subject: [PATCH 08/12] Add Lightgrey --- src/constants.h | 1 + src/gui.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/constants.h b/src/constants.h index d1ab402..d4628fa 100644 --- a/src/constants.h +++ b/src/constants.h @@ -147,6 +147,7 @@ #define White 0xFFFF /* 31, 63, 31 */ #define Yellow 0xFFE0 /* 31, 63, 0 */ #define Yolk 0xED20 /* 29, 41, 0 */ +#define Lightgrey 0x39A7 /* 7, 13, 7 */ //SMOOTH COLORS #define CabbageSmooth 0x0184 /* 0, 12, 4 */ #define CoralSmooth 0x4124 /* 8, 9, 4 */ diff --git a/src/gui.cpp b/src/gui.cpp index 2a241e9..e7514aa 100644 --- a/src/gui.cpp +++ b/src/gui.cpp @@ -20,7 +20,8 @@ void doTheme() { // Use this to put your own colors in: http://www.barth-dev.de SecondaryColor = Skyblue; SecondaryColorSmooth = SkyblueSmooth; FrameColor = Blue; - GreyoutColor = Darkgrey; + // GreyoutColor = Darkgrey; + GreyoutColor = Lightgrey; BackgroundColor = Black; ActiveColor = White; ActiveColorSmooth = WhiteSmooth; @@ -395,7 +396,8 @@ void doTheme() { // Use this to put your own colors in: http://www.barth-dev.de SecondaryColor = Skyblue; SecondaryColorSmooth = SkyblueSmooth; FrameColor = Blue; - GreyoutColor = Darkgrey; + // GreyoutColor = Darkgrey; + GreyoutColor = Lightgrey; BackgroundColor = Black; ActiveColor = White; ActiveColorSmooth = WhiteSmooth; From ad361e57c06096edf9bf7b8d8ccfc05de8238599 Mon Sep 17 00:00:00 2001 From: Leon Date: Thu, 22 Aug 2024 16:21:15 +0800 Subject: [PATCH 09/12] Some color tweaks to suit IPS screens --- src/gui.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui.cpp b/src/gui.cpp index e7514aa..ffc0408 100644 --- a/src/gui.cpp +++ b/src/gui.cpp @@ -111,7 +111,8 @@ void doTheme() { // Use this to put your own colors in: http://www.barth-dev.de case 3: // Monochrome theme PrimaryColor = White; PrimaryColorSmooth = Black; - SecondaryColor = PureGrey; + // SecondaryColor = PureGrey; + SecondaryColor = White; SecondaryColorSmooth = Black; FrameColor = GreenGrey; GreyoutColor = PaleGrey; From f60970617bb2b17023f4eb7c6216f19a5a4bd9ff Mon Sep 17 00:00:00 2001 From: Leon Date: Sat, 31 Aug 2024 12:14:08 +0800 Subject: [PATCH 10/12] Save frequency after TuneFreq --- TEF6686_ESP32.ino | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/TEF6686_ESP32.ino b/TEF6686_ESP32.ino index 81e2ccc..11d1edf 100644 --- a/TEF6686_ESP32.ino +++ b/TEF6686_ESP32.ino @@ -4974,7 +4974,12 @@ void NumpadProcess(int num) if (XDRGTKUSB || XDRGTKTCP) { if (band == BAND_FM) DataPrint("M0\nT" + String(frequency * 10) + "\n"); else if (band == BAND_OIRT) DataPrint("M0\nT" + String(frequency_OIRT * 10) + "\n"); else DataPrint("M1\nT" + String(frequency_AM) + "\n"); } - ShowFreq(0); + if (!memorystore) { + if (!memtune) radio.clearRDS(fullsearchrds); + memtune = false; + ShowFreq(0); + store = true; + } } freq_in = 0; } From 739a59bddd021d9f7a2d25d54200a84c466041a9 Mon Sep 17 00:00:00 2001 From: Leon Date: Tue, 17 Sep 2024 17:06:13 +0800 Subject: [PATCH 11/12] Remove unwanted colors --- src/constants.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/constants.h b/src/constants.h index ef8d06e..1697628 100644 --- a/src/constants.h +++ b/src/constants.h @@ -149,7 +149,6 @@ #define White 0xFFFF /* 31, 63, 31 */ #define Yellow 0xFFE0 /* 31, 63, 0 */ #define Yolk 0xED20 /* 29, 41, 0 */ -#define Lightgrey 0x39A7 /* 7, 13, 7 */ //SMOOTH COLORS #define CabbageSmooth 0x0184 /* 0, 12, 4 */ #define CoralSmooth 0x4124 /* 8, 9, 4 */ From 2bebe1f56e9de8006ce50223dce3f48c2c081b24 Mon Sep 17 00:00:00 2001 From: BH5HNU Date: Tue, 17 Sep 2024 17:13:07 +0800 Subject: [PATCH 12/12] Update config.h --- src/config.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/config.h b/src/config.h index 6749a3d..567ee66 100644 --- a/src/config.h +++ b/src/config.h @@ -5,6 +5,6 @@ // #define HAS_AIR_BAND // uncomment to enable Air Band(Make sure you have Air Band extend board) // #define CHINA_PORTABLE // uncomment for China Portable build (Simplified Chinese) -#define DEEPELEC_DP_66X // uncomment for DEEPELEC Portable DP-66X build (Simplified Chinese) +// #define DEEPELEC_DP_66X // uncomment for DEEPELEC Portable DP-66X build (Simplified Chinese) -#endif \ No newline at end of file +#endif