From bbeae37fa48aed5417e34e1ff8fa58583af76626 Mon Sep 17 00:00:00 2001 From: andimik Date: Sat, 8 Jun 2024 10:13:32 +0200 Subject: [PATCH 01/21] links to zip-files for external libraries instead of repository - in a Github repository it's not so easy to find the download button for the zip file, which is needed for the Arduino IDE setup. - added a hint that the `User_Setup.h` file needs to be edited afterwards --- TEF6686_ESP32.ino | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/TEF6686_ESP32.ino b/TEF6686_ESP32.ino index d55bac4..6c3fecc 100644 --- a/TEF6686_ESP32.ino +++ b/TEF6686_ESP32.ino @@ -4,9 +4,9 @@ #include #include #include -#include // https://github.com/fbiego/ESP32Time -#include // https://github.com/ohmytime/TFT_eSPI_DynamicSpeed (Modified version) -#include // https://github.com/bbx10/Hash_tng +#include // https://github.com/fbiego/ESP32Time/archive/refs/heads/main.zip +#include // https://github.com/ohmytime/TFT_eSPI_DynamicSpeed/archive/refs/heads/master.zip (please then edit the User_Setup.h as described in the Wiki) +#include // https://github.com/bbx10/Hash_tng/archive/refs/heads/master.zip #include "src/WiFiConnect.h" #include "src/WiFiConnectParam.h" #include "src/FONT16.h" From 6c36b08d0c4afc5a86af2cc300e2f925370ee6e1 Mon Sep 17 00:00:00 2001 From: Sjef Verhoeven PE5PVB Date: Sat, 8 Jun 2024 17:45:29 +0200 Subject: [PATCH 02/21] Fix AF tuning while screenmute active --- TEF6686_ESP32.ino | 1 + 1 file changed, 1 insertion(+) diff --git a/TEF6686_ESP32.ino b/TEF6686_ESP32.ino index d55bac4..bcd4c9c 100644 --- a/TEF6686_ESP32.ino +++ b/TEF6686_ESP32.ino @@ -895,6 +895,7 @@ void loop() { radio.clearRDS(fullsearchrds); } if (XDRGTKUSB || XDRGTKTCP) DataPrint("T" + String((frequency + ConverterSet * 100) * 10) + "\n"); + if (!screenmute) freqold = frequency; store = true; } } From b1d83c0b524ef0e1cc454569f464b45eab9514fb Mon Sep 17 00:00:00 2001 From: Sjef Verhoeven PE5PVB Date: Sat, 8 Jun 2024 18:03:35 +0200 Subject: [PATCH 03/21] Do not round frequencies for memory storage --- TEF6686_ESP32.ino | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/TEF6686_ESP32.ino b/TEF6686_ESP32.ino index 87709cc..dd3e69a 100644 --- a/TEF6686_ESP32.ino +++ b/TEF6686_ESP32.ino @@ -104,6 +104,7 @@ bool scanmute; bool screenmute; bool screensavertriggered = false; bool seek; +bool seekinit; bool setupmode; bool showclock; bool usesquelch; @@ -2465,6 +2466,7 @@ void ButtonPress() { EEPROM.writeByte(memorypos + EE_PRESET_MS_START, StereoToggle); if (band == BAND_FM) {//todo air EEPROM.writeUInt((memorypos * 4) + EE_PRESETS_FREQUENCY_START, frequency); + Serial.println(frequency); } else if (band == BAND_OIRT) { EEPROM.writeUInt((memorypos * 4) + EE_PRESETS_FREQUENCY_START, frequency_OIRT); } else if (band == BAND_LW) { @@ -2616,6 +2618,7 @@ void KeyUp() { case TUNE_AUTO: direction = true; seek = true; + seekinit = true; Seek(direction); break; @@ -2682,6 +2685,7 @@ void KeyDown() { case TUNE_AUTO: direction = false; seek = true; + seekinit = true; Seek(direction); break; @@ -3638,11 +3642,6 @@ void doTuneMode() { } else { tunemode = TUNE_AUTO; } - if (stepsize != 0) { - stepsize = 0; - RoundStep(); - ShowStepSize(); - } break; case TUNE_MI_BAND: @@ -4025,6 +4024,15 @@ void EdgeBeeper() { void Seek(bool mode) { radio.setMute(); + if (seekinit) { + if (stepsize != 0) { + stepsize = 0; + RoundStep(); + ShowStepSize(); + } + seekinit = false; + } + if (!screenmute) { tft.drawBitmap(92, 4, Speaker, 26, 22, PrimaryColor); } From dfa3ed3dbd8dc184944f4d6116d2e9dcdcebcb4f Mon Sep 17 00:00:00 2001 From: Sjef Verhoeven PE5PVB Date: Sat, 8 Jun 2024 18:17:00 +0200 Subject: [PATCH 04/21] Romanian and Czech update --- src/language.h | 76 +++++++++++++++++++++++++------------------------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/src/language.h b/src/language.h index 5e59430..2af3e2e 100644 --- a/src/language.h +++ b/src/language.h @@ -1374,8 +1374,8 @@ static const char* const myLanguage[18][263] PROGMEM = { "Alegeți Limba", // 40 "Apasați MODE ptr MEMORARE și ieșire", // 41 "Pornit", // 42 - "lipsă zgomot FM", // 43 - "lipsă zgomot AM", // 44 + "Lipsă zgomot FM", // 43 + "Lipsă zgomot AM", // 44 "Beep la capătul benzii", // 45 "Regiune", // 46 "Europa", // 47 @@ -1385,7 +1385,7 @@ static const char* const myLanguage[18][263] PROGMEM = { "Wi-Fi activ", // 51 "Configurare Wi-Fi", // 52 "Conectare la: ", // 53 - "ptr configurare Wi-Fi", // 54 + "Ptr configurare Wi-Fi", // 54 "Incerc conectarea la Wi-Fi", // 55 "Fară succes!", // 56 "Conectat!", // 57 @@ -1393,16 +1393,16 @@ static const char* const myLanguage[18][263] PROGMEM = { "Arată lungimea de undă SW", // 59 "Filtru RDS", // 60 "Arată erorile PI", // 61 - "folosește squelch", // 62 + "Folosește squelch", // 62 "Contor modulație", // 63 "Eliminator de zgomot AM", // 64 "Eliminator de zgomot FM", // 65 "Revenire la setările de fabrică", // 66 - "ieșire Audio", // 67 + "Ieșire Audio", // 67 "Permite reglarea in timp ce ecranul este oprit", // 68 "Ecran inversat", // 69 "Despre software", // 70 - "cod principal:", // 71 + "Cod principal:", // 71 "Contribuitori:", // 72 "Necunoscut", // 73 "Opțiuni economizor ecran", // 74 @@ -1415,7 +1415,7 @@ static const char* const myLanguage[18][263] PROGMEM = { "Viteză SPI dinamică", // 81 "Sensibilitatea scanării", // 82 "NICI UNUL", // 83 - " versiune Software", // 84 + "Versiune Software", // 84 "Font Frecvență", // 85 "Auto", // 86 "AF nu este disponibil", // 87 @@ -1425,12 +1425,12 @@ static const char* const myLanguage[18][263] PROGMEM = { "Screensaver", // 91 "Sec", // 92 "Apăsați BAND pentru inchidere", // 93 - "luminozitate 1%", // 94 - "luminozitate 25%", // 95 - "luminozitate 50%", // 96 + "Luminozitate 1%", // 94 + "Luminozitate 25%", // 95 + "Luminozitate 50%", // 96 "Decalaj de nivel AM RF", // 97 - "unitați S-metru", // 98 - "folosești AF", // 99 + "Unitați S-metru", // 98 + "Folosești AF", // 99 "Selectare banda FM", // 100 "Selectare banda AM", // 101 "LW", // 102 @@ -1439,7 +1439,7 @@ static const char* const myLanguage[18][263] PROGMEM = { "FM", // 105 "OIRT", // 106 "Rotire când ecranul este oprit", // 107 - "selectare Model", // 108 + "Selectare Model", // 108 "Bază (ILI9341)", // 109 "Portabil (ILI9341)", // 110 "Portabil touch (ILI9341)", // 111 @@ -1500,14 +1500,14 @@ static const char* const myLanguage[18][263] PROGMEM = { "Identificare", // 166 "Cumpără", // 167 "Preiau date", // 168 - "pași MW impliciți", // 169 + "Pași MW impliciți", // 169 "Tangerine", // 170 "Ocean", // 171 "Indigo", // 172 "Opțiuni Baterie", // 173 "Arată tensiunea", // 174 "Arată procente", // 175 - "porțiune RT", // 176 + "Porțiune RT", // 176 "Setări de bază", // 177 "Setări Audio", // 178 "Setări ecran", // 179 @@ -2090,34 +2090,34 @@ static const char* const myLanguage[18][263] PROGMEM = { "Vypnout displej", // 226 "Zakázáno", // 227 "Nedefinovaný pr.", // 228 - "Zpravy", // 229 + "Zprávy", // 229 "Publicistika", // 230 "Informace", // 231 "Sport", // 232 - "Vzdelani", // 233 + "Vzdělání", // 233 "Drama", // 234 "Kultura", // 235 - "Veda", // 236 - "Ruzne Zanry", // 237 - "Popova Hudba", // 238 - "Rockova Hudba", // 239 - "Oddychova Hudba", // 240 - "Klasicka Hudba", // 241 - "Vazna Hudba", // 242 - "Jina Hudba", // 243 - "Pocasi", // 244 + "Věda", // 236 + "Různé žánry", // 237 + "Popová hudba", // 238 + "Rocková hudba", // 239 + "Oddychová hudba", // 240 + "Klasická hudba", // 241 + "Vážná hudba", // 242 + "Jiná hudba", // 243 + "Počasí", // 244 "Finance", // 245 - "Detsky Program", // 246 - "Spolecenska Tem.", // 247 - "Nabozens. Temata", // 248 - "Telefonaty", // 249 - "Cestovani", // 250 - "Zabava", // 251 - "Jazzova Hudba", // 252 - "Country Hudba", // 253 - "Narodni Hudba", // 254 - "Oldies Hudba", // 255 - "Folkova Hudba", // 256 + "Dětský program", // 246 + "Společenská tém.", // 247 + "Naboženství", // 248 + "Telefonáty", // 249 + "Cestování", // 250 + "Zábava", // 251 + "Jazzová hudba", // 252 + "Country hudba", // 253 + "Národní hudba", // 254 + "Oldies hudba", // 255 + "Folková hudba", // 256 "Dokumenty", // 257 "Alarm Test", // 258 "Alarm – Alarm !", // 259 @@ -4776,4 +4776,4 @@ static const char* const myLanguage[18][263] PROGMEM = { "Mostrar relógio" // 262 } }; -#endif +#endif \ No newline at end of file From 646460306b1b57c3f05238d339334d6ad5ce674f Mon Sep 17 00:00:00 2001 From: Sjef Verhoeven PE5PVB Date: Sun, 9 Jun 2024 00:22:04 +0200 Subject: [PATCH 05/21] Fix wrong interruption of seek during screenmute --- TEF6686_ESP32.ino | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/TEF6686_ESP32.ino b/TEF6686_ESP32.ino index dd3e69a..6621d4f 100644 --- a/TEF6686_ESP32.ino +++ b/TEF6686_ESP32.ino @@ -1616,6 +1616,8 @@ void ToggleBand(byte nowBand) { } void BANDBUTTONPress() { + if (seek) radio.setUnMute(); + seek = false; if (scandxmode) { cancelDXScan(); } else { @@ -2086,7 +2088,6 @@ void SelectBand() { if (afscreen || advancedRDS) BuildDisplay(); if (band > BAND_GAP) { - seek = false; if (!screenmute) tft.drawBitmap(92, 4, Speaker, 26, 22, GreyoutColor); if (tunemode == TUNE_MI_BAND && band != BAND_SW) tunemode = TUNE_MAN; BWreset = true; @@ -2200,12 +2201,13 @@ void SelectBand() { } void BWButtonPress() { + if (seek) radio.setUnMute(); + seek = false; if (scandxmode) { cancelDXScan(); } else { if (!usesquelch) radio.setUnMute(); if (!menu) { - seek = false; if (!screenmute) tft.drawBitmap(92, 4, Speaker, 26, 22, GreyoutColor); unsigned long counterold = millis(); unsigned long counter = millis(); @@ -2259,6 +2261,8 @@ void doStereoToggle() { } void ModeButtonPress() { + if (seek) radio.setUnMute(); + seek = false; if (scandxmode) { cancelDXScan(); } else { @@ -2272,7 +2276,6 @@ void ModeButtonPress() { BuildAFScreen(); } else { if (!menu) { - seek = false; if (!screenmute) { tft.drawBitmap(92, 4, Speaker, 26, 22, GreyoutColor); } @@ -2442,6 +2445,8 @@ void RoundStep() {//todo air } void ButtonPress() { + if (seek) radio.setUnMute(); + seek = false; if (scandxmode) { cancelDXScan(); } else { @@ -2466,7 +2471,6 @@ void ButtonPress() { EEPROM.writeByte(memorypos + EE_PRESET_MS_START, StereoToggle); if (band == BAND_FM) {//todo air EEPROM.writeUInt((memorypos * 4) + EE_PRESETS_FREQUENCY_START, frequency); - Serial.println(frequency); } else if (band == BAND_OIRT) { EEPROM.writeUInt((memorypos * 4) + EE_PRESETS_FREQUENCY_START, frequency_OIRT); } else if (band == BAND_LW) { @@ -2517,7 +2521,6 @@ void ButtonPress() { } } } else { - seek = false; if (!screenmute) tft.drawBitmap(92, 4, Speaker, 26, 22, GreyoutColor); unsigned long counterold = millis(); unsigned long counter = millis(); From 9e1b95c2c9dad63afd8755e70aa3bbadfe57595e Mon Sep 17 00:00:00 2001 From: Sjef Verhoeven PE5PVB Date: Sun, 9 Jun 2024 00:48:28 +0200 Subject: [PATCH 06/21] Replaced space for underscore in Stationlist message --- TEF6686_ESP32.ino | 10 +++++----- src/rds.cpp | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/TEF6686_ESP32.ino b/TEF6686_ESP32.ino index 6621d4f..6dc11de 100644 --- a/TEF6686_ESP32.ino +++ b/TEF6686_ESP32.ino @@ -3009,11 +3009,11 @@ void ShowFreq(int mode) { if (wifi) { Udp.beginPacket(remoteip, 9030); if (band == BAND_FM) { - Udp.print("from=TEF_tuner " + String(stationlistid, DEC) + ";freq=" + String(frequency) + "0000"); + Udp.print("from=TEF_tuner_" + String(stationlistid, DEC) + ";freq=" + String(frequency) + "0000"); } else if (band == BAND_OIRT) { - Udp.print("from=TEF_tuner " + String(stationlistid, DEC) + ";freq=" + String(frequency_OIRT) + "0000"); + Udp.print("from=TEF_tuner_" + String(stationlistid, DEC) + ";freq=" + String(frequency_OIRT) + "0000"); } else { - Udp.print("from=TEF_tuner " + String(stationlistid, DEC) + ";freq=" + String(frequency_AM) + "000"); + Udp.print("from=TEF_tuner_" + String(stationlistid, DEC) + ";freq=" + String(frequency_AM) + "000"); } Udp.endPacket(); } @@ -3099,7 +3099,7 @@ void ShowSignalLevel() { if (wifi && millis() >= udptimer + 2000) { udptimer = millis(); Udp.beginPacket(remoteip, 9030); - Udp.print("from=TEF_tuner " + String(stationlistid, DEC) + ";RcvLevel=" + String(SStatus / 10)); + Udp.print("from=TEF_tuner_" + String(stationlistid, DEC) + ";RcvLevel=" + String(SStatus / 10)); Udp.endPacket(); } } @@ -3253,7 +3253,7 @@ void ShowBW() { BWreset = false; if (wifi) { Udp.beginPacket(remoteip, 9030); - Udp.print("from=TEF_tuner " + String(stationlistid, DEC) + ";bandwidth=" + String(BW * 1000)); + Udp.print("from=TEF_tuner_" + String(stationlistid, DEC) + ";bandwidth=" + String(BW * 1000)); Udp.endPacket(); } } diff --git a/src/rds.cpp b/src/rds.cpp index de3e135..9b9754a 100644 --- a/src/rds.cpp +++ b/src/rds.cpp @@ -269,7 +269,7 @@ void doAF() { if (radio.af_counter != af_counterold && radio.rds.hasAF) { if (wifi) { Udp.beginPacket(remoteip, 9030); - Udp.print("from=TEF_tuner " + String(stationlistid, DEC) + ";AF="); + Udp.print("from=TEF_tuner_" + String(stationlistid, DEC) + ";AF="); for (byte af_scan = 0; af_scan < radio.af_counter; af_scan++) { if (wifi) { @@ -303,7 +303,7 @@ void showECC() { if (wifi) { Udp.beginPacket(remoteip, 9030); - Udp.print("from=TEF_tuner " + String(stationlistid, DEC) + ";ECC="); + Udp.print("from=TEF_tuner_" + String(stationlistid, DEC) + ";ECC="); if (radio.rds.ECC < 0x10) Udp.print("0"); Udp.print(String(radio.rds.ECC, HEX)); Udp.endPacket(); @@ -629,7 +629,7 @@ void showPI() { if (wifi) { Udp.beginPacket(remoteip, 9030); - Udp.print("from=TEF_tuner " + String(stationlistid, DEC) + ";PI=" + String(radio.rds.picode, 4)); + Udp.print("from=TEF_tuner_" + String(stationlistid, DEC) + ";PI=" + String(radio.rds.picode, 4)); Udp.endPacket(); } } @@ -659,7 +659,7 @@ void showPTY() { if (wifi) { Udp.beginPacket(remoteip, 9030); - Udp.print("from=TEF_tuner " + String(stationlistid, DEC) + ";PTY="); + Udp.print("from=TEF_tuner_" + String(stationlistid, DEC) + ";PTY="); Udp.print(String(radio.rds.stationTypeCode, HEX)); Udp.endPacket(); } @@ -719,7 +719,7 @@ void showPS() { if (wifi && radio.rds.stationName.length() > 0 && PSold != radio.rds.stationName) { Udp.beginPacket(remoteip, 9030); - Udp.print("from=TEF_tuner " + String(stationlistid, DEC) + ";PS="); + Udp.print("from=TEF_tuner_" + String(stationlistid, DEC) + ";PS="); char PShex[9]; radio.rds.stationName.toCharArray(PShex, 9); for (int i = 0; i < 8; i++) @@ -857,7 +857,7 @@ void showRadioText() { if (wifi) { Udp.beginPacket(remoteip, 9030); - Udp.print("from=TEF_tuner " + String(stationlistid, DEC) + ";RT1="); + Udp.print("from=TEF_tuner_" + String(stationlistid, DEC) + ";RT1="); char RThex[65]; radio.rds.stationText.toCharArray(RThex, 65); for (int i = 0; i < 64; i++) { From ff2fac98295ff3703471ecceea104bf08c7b6ab3 Mon Sep 17 00:00:00 2001 From: Sjef Verhoeven PE5PVB Date: Sun, 9 Jun 2024 21:48:54 +0200 Subject: [PATCH 07/21] Small correction on RDS and Wifi indicators --- src/constants.h | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/constants.h b/src/constants.h index 3692578..f4e6005 100644 --- a/src/constants.h +++ b/src/constants.h @@ -312,7 +312,7 @@ #define EE_BYTE_SCANMUTE 2213 #define EE_BYTE_AUTOSQUELCH 2214 #define EE_BYTE_LONGBANDPRESS 2215 -#define EE_BYTE_SHOWCLOCK 2216 +#define EE_BYTE_SHOWCLOCK 2216 #ifdef HAS_AIR_BAND #define EE_BYTE_AIRSTEPSIZE 2117 #define EE_UINT16_FREQUENCY_AIR 2218 @@ -422,7 +422,7 @@ static const uint8_t TEFLogo[] PROGMEM = { static const uint8_t RDSLogo[] PROGMEM = { 0x01, 0xf8, 0x0f, 0xe0, 0x00, - 0x02, 0x00, 0x30, 0x18, 0x00, + 0x07, 0x80, 0x30, 0x18, 0x00, 0x0c, 0x30, 0x43, 0xc6, 0x00, 0x11, 0xc0, 0x8c, 0x31, 0x00, 0x26, 0x01, 0x31, 0x8c, 0x80, @@ -491,11 +491,11 @@ static const uint8_t WiFi1[] PROGMEM = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, - 0x00, 0x08, 0x00, 0x00 + 0x00, 0x08, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00 }; static const uint8_t WiFi2[] PROGMEM = { @@ -513,7 +513,6 @@ static const uint8_t WiFi2[] PROGMEM = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0xff, 0x80, 0x00, @@ -523,7 +522,8 @@ static const uint8_t WiFi2[] PROGMEM = { 0x00, 0x1c, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, - 0x00, 0x08, 0x00, 0x00 + 0x00, 0x08, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00 }; static const uint8_t WiFi3[] PROGMEM = { @@ -534,7 +534,6 @@ static const uint8_t WiFi3[] PROGMEM = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x01, 0xff, 0xc0, 0x00, 0x03, 0xff, 0xe0, 0x00, @@ -551,7 +550,8 @@ static const uint8_t WiFi3[] PROGMEM = { 0x00, 0x1c, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, - 0x00, 0x08, 0x00, 0x00 + 0x00, 0x08, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00 }; static const uint8_t WiFi4[] PROGMEM = { @@ -578,7 +578,8 @@ static const uint8_t WiFi4[] PROGMEM = { 0x00, 0x1c, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, - 0x00, 0x08, 0x00, 0x00 + 0x00, 0x08, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00 }; static const uint16_t openradiologo[] PROGMEM = { From e2b8760e35aaf3e4a0595330bfa7028618335c54 Mon Sep 17 00:00:00 2001 From: Sjef Verhoeven PE5PVB Date: Sun, 9 Jun 2024 22:53:48 +0200 Subject: [PATCH 08/21] Move AUTO BW icon 1px left --- TEF6686_ESP32.ino | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/TEF6686_ESP32.ino b/TEF6686_ESP32.ino index 6dc11de..daf3a7d 100644 --- a/TEF6686_ESP32.ino +++ b/TEF6686_ESP32.ino @@ -3474,14 +3474,14 @@ void doSquelch() { void updateBW() {//todo air if (BWset == 0) { if (!screenmute && !advancedRDS && !afscreen) { - tft.drawRoundRect(248, 35, 71, 20, 5, ActiveColor); - tftPrint(0, "AUTO BW", 283, 38, ActiveColor, ActiveColorSmooth, 16); + tft.drawRoundRect(247, 35, 71, 20, 5, ActiveColor); + tftPrint(0, "AUTO BW", 282, 38, ActiveColor, ActiveColorSmooth, 16); } radio.setFMABandw(); } else { if (!screenmute && !advancedRDS && !afscreen) { - tft.drawRoundRect(248, 35, 71, 20, 5, GreyoutColor); - tftPrint(0, "AUTO BW", 283, 38, GreyoutColor, BackgroundColor, 16); + tft.drawRoundRect(247, 35, 71, 20, 5, GreyoutColor); + tftPrint(0, "AUTO BW", 282, 38, GreyoutColor, BackgroundColor, 16); } } } From 4f87b0fe5961b83774c9b20532b09fdf33c51d29 Mon Sep 17 00:00:00 2001 From: Sjef Verhoeven PE5PVB Date: Sun, 9 Jun 2024 22:55:40 +0200 Subject: [PATCH 09/21] Versioning --- src/language.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/language.h b/src/language.h index 2af3e2e..f3c7a60 100644 --- a/src/language.h +++ b/src/language.h @@ -1,7 +1,7 @@ #ifndef LANGUAGE_H #define LANGUAGE_H -#define VERSION "v2.10 RC14" +#define VERSION "v2.10 RC15" // [number of languages][number of texts] From 6c60d0442379705c8c2ce1e7d5ff5afc8f803d61 Mon Sep 17 00:00:00 2001 From: Sjef Verhoeven PE5PVB Date: Mon, 10 Jun 2024 10:03:26 +0200 Subject: [PATCH 10/21] Fixed regression no audio after opening AF screen --- src/TEF6686.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/TEF6686.cpp b/src/TEF6686.cpp index bbebe0a..9a104bc 100644 --- a/src/TEF6686.cpp +++ b/src/TEF6686.cpp @@ -49,7 +49,7 @@ void TEF6686::TestAFEON() { } } devTEF_Set_Cmd(TEF_FM, Cmd_Tune_To, 7, 4, currentfreq); - if (!mute) setUnMute(); + setUnMute(); } uint16_t TEF6686::TestAF() { From 2e614c4c6d62901355626d5441dae258cc9f685e Mon Sep 17 00:00:00 2001 From: Sjef Verhoeven PE5PVB Date: Mon, 10 Jun 2024 10:18:46 +0200 Subject: [PATCH 11/21] Fixed regression PS overlapping in AF view --- src/rds.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rds.cpp b/src/rds.cpp index 9b9754a..a73d405 100644 --- a/src/rds.cpp +++ b/src/rds.cpp @@ -730,8 +730,8 @@ void showPS() { } Udp.endPacket(); } - PSold = radio.rds.stationName; } + PSold = radio.rds.stationName; } } From 58ee9fabee159f7f21d5fb07d670c7c2c3e9cd6a Mon Sep 17 00:00:00 2001 From: Sjef Verhoeven PE5PVB Date: Mon, 10 Jun 2024 19:02:37 +0200 Subject: [PATCH 12/21] Fixed bug with AF tuning while screenmute --- TEF6686_ESP32.ino | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/TEF6686_ESP32.ino b/TEF6686_ESP32.ino index daf3a7d..ad3ce61 100644 --- a/TEF6686_ESP32.ino +++ b/TEF6686_ESP32.ino @@ -896,7 +896,10 @@ void loop() { radio.clearRDS(fullsearchrds); } if (XDRGTKUSB || XDRGTKTCP) DataPrint("T" + String((frequency + ConverterSet * 100) * 10) + "\n"); - if (!screenmute) freqold = frequency; + if (screenmute) { + freqold = frequency; + dropout = false; + } store = true; } } @@ -914,6 +917,10 @@ void loop() { radio.clearRDS(fullsearchrds); } if (XDRGTKUSB || XDRGTKTCP) DataPrint("T" + String((frequency + ConverterSet * 100) * 10) + "\n"); + if (screenmute) { + freqold = frequency; + dropout = false; + } store = true; } } @@ -931,6 +938,10 @@ void loop() { } if (XDRGTKUSB || XDRGTKTCP) DataPrint("T" + String((frequency + ConverterSet * 100) * 10) + "\n"); store = true; + if (screenmute) { + freqold = frequency; + dropout = false; + } } } } From c2e697d13b367cb5ef5aed4eb0b663cd1c70458c Mon Sep 17 00:00:00 2001 From: Sjef Verhoeven PE5PVB Date: Mon, 10 Jun 2024 19:07:38 +0200 Subject: [PATCH 13/21] Small GUI correction on modulation meter --- TEF6686_ESP32.ino | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/TEF6686_ESP32.ino b/TEF6686_ESP32.ino index ad3ce61..7b28737 100644 --- a/TEF6686_ESP32.ino +++ b/TEF6686_ESP32.ino @@ -3301,12 +3301,12 @@ void ShowModLevel() { } } - tft.fillRect(16, 133, 2 * constrain(DisplayedSegments, 0, 53), 6, ModBarInsignificantColor); + tft.fillRect(16, 133, 2 * constrain(DisplayedSegments, 0, 54), 6, ModBarInsignificantColor); - if (DisplayedSegments > 53) tft.fillRect(16 + 2 * 53, 133, 2 * (DisplayedSegments - 53), 6, ModBarSignificantColor); + if (DisplayedSegments > 54) tft.fillRect(16 + 2 * 54, 133, 2 * (DisplayedSegments - 54), 6, ModBarSignificantColor); int greyStart = 16 + 2 * DisplayedSegments; - int greyWidth = 2 * (94 - DisplayedSegments); // Calculate the remaining width correctly + int greyWidth = 2 * (94 - DisplayedSegments); tft.fillRect(greyStart, 133, greyWidth, 6, GreyoutColor); int peakHoldPosition = 16 + 2 * constrain(peakholdold, 0, 93); From 776aaef787326577179673015114d1a9a989f5c8 Mon Sep 17 00:00:00 2001 From: Sjef Verhoeven PE5PVB Date: Tue, 11 Jun 2024 20:19:56 +0200 Subject: [PATCH 14/21] Added command 'K' to XDRGTK protocol to adjust scanhold --- src/comms.cpp | 11 +++++++++++ src/comms.h | 1 + 2 files changed, 12 insertions(+) diff --git a/src/comms.cpp b/src/comms.cpp index ca0895a..7cd1e81 100644 --- a/src/comms.cpp +++ b/src/comms.cpp @@ -515,6 +515,17 @@ void XDRGTKRoutine() { DataPrint("J" + String(scandxtemp) + "\n"); break; + case 'K': + byte scanholdtemp; + scanholdtemp = atol(buff + 1); + if (scanholdtemp < 31) { + scanhold = scanholdtemp; + EEPROM.writeByte(EE_BYTE_SCANHOLD, scanhold); + EEPROM.commit(); + } + DataPrint("K" + String(scanhold) + "\n"); + break; + case 'M': byte XDRband; XDRband = atol(buff + 1); diff --git a/src/comms.h b/src/comms.h index 25f299e..f795478 100644 --- a/src/comms.h +++ b/src/comms.h @@ -47,6 +47,7 @@ extern byte iMSEQ; extern byte iMSset; extern byte language; extern byte memorypos; +extern byte scanhold; extern byte stepsize; extern byte subnetclient; extern byte TEF; From 84d6832d753fa5c9f676b5ad84937fd68408b32d Mon Sep 17 00:00:00 2001 From: Sjef Verhoeven PE5PVB Date: Wed, 12 Jun 2024 16:39:13 +0200 Subject: [PATCH 15/21] Versioning --- src/language.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/language.h b/src/language.h index f3c7a60..dbf9039 100644 --- a/src/language.h +++ b/src/language.h @@ -1,7 +1,7 @@ #ifndef LANGUAGE_H #define LANGUAGE_H -#define VERSION "v2.10 RC15" +#define VERSION "v2.10 RC16" // [number of languages][number of texts] From 7396f4a71a9a33e9aa2c8946f001b7ddcded0bf7 Mon Sep 17 00:00:00 2001 From: Sjef Verhoeven PE5PVB Date: Wed, 12 Jun 2024 18:32:23 +0200 Subject: [PATCH 16/21] Set menuflag when entering FM DX scanner --- TEF6686_ESP32.ino | 1 + 1 file changed, 1 insertion(+) diff --git a/TEF6686_ESP32.ino b/TEF6686_ESP32.ino index 7b28737..90e7dab 100644 --- a/TEF6686_ESP32.ino +++ b/TEF6686_ESP32.ino @@ -4507,6 +4507,7 @@ void endMenu() { } void startFMDXScan() { + menu = false; initdxscan = true; if (afscreen || advancedRDS) BuildDisplay(); From 04fc88561fb53d85d3dff83816ae31b8d0ad053c Mon Sep 17 00:00:00 2001 From: Sjef Verhoeven PE5PVB Date: Fri, 14 Jun 2024 21:59:02 +0200 Subject: [PATCH 17/21] Update USA Callsign database --- data/USA_90-92.csv | 2 +- data/USA_94-96.csv | 4 ++-- data/USA_96-98.csv | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/data/USA_90-92.csv b/data/USA_90-92.csv index 6a8cb0b..5213bf8 100644 --- a/data/USA_90-92.csv +++ b/data/USA_90-92.csv @@ -1707,7 +1707,7 @@ 20235;9130;KXWT;TX 21043;9130;KZBV;CA 21118;9130;KZES;TX -21303;9130;KZLV;TX +12103;9130;KZLV;TX 21941;9130;WAKJ;FL 22080;9130;WAPS;OH 22127;9130;WARN;VA diff --git a/data/USA_94-96.csv b/data/USA_94-96.csv index 03154d4..67d182c 100644 --- a/data/USA_94-96.csv +++ b/data/USA_94-96.csv @@ -983,7 +983,7 @@ 6870;9490;KECS;LA 6911;9490;K235CP;ID 7163;9490;KENZ;UT -7177;9490;KEON;TX +17523;9490;KEON;TX 7288;9490;KESU;HI 9165;9490;KHMZ;TX 9286;9490;KHRQ;CA @@ -1938,7 +1938,7 @@ 8489;9570;KGMZ;CA 10285;9570;KJEB;WA 10333;9570;KJFX;CA -10865;9570;KKAJ;OK +61576;9570;KKAJ;OK 11045;9570;KKHH;TX 11230;9570;KKOK;MN 11341;9570;KKSR;WA diff --git a/data/USA_96-98.csv b/data/USA_96-98.csv index acef9d9..d58cec3 100644 --- a/data/USA_96-98.csv +++ b/data/USA_96-98.csv @@ -8,7 +8,7 @@ 5282;9610;KBTQ;TX 5316;9610;KSME;CO 5453;9610;KIBT;CO -5531;9610;KCDF;TX +53712;9610;KCDF;TX 5563;9610;KCEL;CA 5628;9610;WSRS;MA 5890;9610;KISO;NE From ca9dd47e2506b535a54756c9a2020270583f1bd1 Mon Sep 17 00:00:00 2001 From: Sjef Verhoeven PE5PVB Date: Fri, 14 Jun 2024 22:18:40 +0200 Subject: [PATCH 18/21] Versioning --- src/language.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/language.h b/src/language.h index dbf9039..a95c254 100644 --- a/src/language.h +++ b/src/language.h @@ -1,7 +1,7 @@ #ifndef LANGUAGE_H #define LANGUAGE_H -#define VERSION "v2.10 RC16" +#define VERSION "v2.10" // [number of languages][number of texts] From d4ec70720dfa41c982b02ec8ffdb3698b4b28640 Mon Sep 17 00:00:00 2001 From: Sjef Verhoeven PE5PVB Date: Sat, 15 Jun 2024 12:44:10 +0200 Subject: [PATCH 19/21] Hotfix: When starting the FM DX scanner from the menu, the screen was not building up properly. --- TEF6686_ESP32.ino | 6 +++--- src/language.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/TEF6686_ESP32.ino b/TEF6686_ESP32.ino index 90e7dab..c90caf1 100644 --- a/TEF6686_ESP32.ino +++ b/TEF6686_ESP32.ino @@ -4507,8 +4507,9 @@ void endMenu() { } void startFMDXScan() { - menu = false; initdxscan = true; + + if (menu) endMenu(); if (afscreen || advancedRDS) BuildDisplay(); if (memorypos > scanstop || memorypos < scanstart) memorypos = scanstart; @@ -4520,7 +4521,6 @@ void startFMDXScan() { band = presets[memorypos].band; SelectBand(); } - if (menu) endMenu(); DoMemoryPosTune(); } else { tunemode = TUNE_MAN; @@ -4528,7 +4528,6 @@ void startFMDXScan() { band = presets[memorypos].band; SelectBand(); } - if (menu) endMenu(); TuneUp(); ShowFreq(0); } @@ -4540,6 +4539,7 @@ void startFMDXScan() { } scantimer = millis(); scandxmode = true; + ShowTuneMode(); if (XDRGTKUSB || XDRGTKTCP) DataPrint("J1\n"); } diff --git a/src/language.h b/src/language.h index a95c254..2896847 100644 --- a/src/language.h +++ b/src/language.h @@ -1,7 +1,7 @@ #ifndef LANGUAGE_H #define LANGUAGE_H -#define VERSION "v2.10" +#define VERSION "v2.11" // [number of languages][number of texts] From 58ea8ec3eee1c6e997da2c0dd36de09650a50dfb Mon Sep 17 00:00:00 2001 From: Sjef Verhoeven PE5PVB Date: Fri, 21 Jun 2024 14:21:43 +0200 Subject: [PATCH 20/21] Show RDS dropout after undo screenmute --- TEF6686_ESP32.ino | 1 + 1 file changed, 1 insertion(+) diff --git a/TEF6686_ESP32.ino b/TEF6686_ESP32.ino index c90caf1..ca625cb 100644 --- a/TEF6686_ESP32.ino +++ b/TEF6686_ESP32.ino @@ -4143,6 +4143,7 @@ void MuteScreen(bool setting) { if (!setting && screenmute) { screenmute = false; setupmode = true; + leave = true; tft.writecommand(0x11); analogWrite(CONTRASTPIN, map(ContrastSet, 0, 100, 15, 255)); if (band < BAND_GAP) { From 0270321b544b667aa3615c613a18ce4599cdab3c Mon Sep 17 00:00:00 2001 From: Sjef Verhoeven PE5PVB Date: Sat, 22 Jun 2024 19:37:50 +0200 Subject: [PATCH 21/21] Added AF search on memory channels --- TEF6686_ESP32.ino | 62 +++++++++++++++++++++++++++++++++++++++++------ src/TEF6686.cpp | 11 +++++++-- src/TEF6686.h | 1 + 3 files changed, 65 insertions(+), 9 deletions(-) diff --git a/TEF6686_ESP32.ino b/TEF6686_ESP32.ino index ca625cb..1f69bee 100644 --- a/TEF6686_ESP32.ino +++ b/TEF6686_ESP32.ino @@ -68,6 +68,7 @@ bool dropout; bool dynamicPTYold; bool edgebeep; bool externaltune; +bool findMemoryAF; bool flashing; bool fmsi; bool fullsearchrds; @@ -603,6 +604,7 @@ void setup() { #endif } + pinMode(BANDBUTTON, INPUT); pinMode(MODEBUTTON, INPUT); pinMode(BWBUTTON, INPUT); pinMode(ROTARY_BUTTON, INPUT); @@ -887,7 +889,51 @@ void loop() { if (!menu && !afscreen && !scandxmode) { if (af != 0 && dropout && millis() >= aftimer + 1000) { aftimer = millis(); - frequency = radio.TestAF(); + if (radio.af_counter == 0) { + if (findMemoryAF && radio.rds.correctPI != 0) { + radio.setMute(); + tft.drawBitmap(92, 4, Speaker, 26, 22, PrimaryColor); + SQ = true; + if (!screenmute) { + if (advancedRDS) { + tft.drawRoundRect(10, 30, 300, 170, 5, ActiveColor); + tft.fillRoundRect(12, 32, 296, 166, 5, BackgroundColor); + tftPrint(0, myLanguage[language][34], 160, 100, ActiveColor, ActiveColorSmooth, 28); + } else { + ShowFreq(1); + } + } + + for (int x = 8750; x <= 10800; x += 10) { + if (rotary != 0 || digitalRead(BANDBUTTON) == LOW || digitalRead(MODEBUTTON) == LOW || digitalRead(BWBUTTON) == LOW || digitalRead(ROTARY_BUTTON) == LOW) break; + radio.SetFreq(x); + unsigned long millisold = millis(); + while (millis() - millisold < 187) { + if (!screenmute && !advancedRDS) ShowModLevel(); + } + if (radio.rds.correctPI == radio.getBlockA()) { + frequency = x; + break; + } + } + + if (!screenmute) { + if (advancedRDS) { + leave = true; + BuildAdvancedRDS(); + } else { + ShowFreq(0); + } + } + + radio.setUnMute(); + SQ = false; + tft.drawBitmap(92, 4, Speaker, 26, 22, GreyoutColor); + } + findMemoryAF = false; + } else { + frequency = radio.TestAF(); + } if (freqold != frequency) { ShowFreq(0); dropout = true; @@ -895,13 +941,13 @@ void loop() { afmethodBold = true; radio.clearRDS(fullsearchrds); } - if (XDRGTKUSB || XDRGTKTCP) DataPrint("T" + String((frequency + ConverterSet * 100) * 10) + "\n"); - if (screenmute) { - freqold = frequency; - dropout = false; - } - store = true; } + if (XDRGTKUSB || XDRGTKTCP) DataPrint("T" + String((frequency + ConverterSet * 100) * 10) + "\n"); + if (screenmute) { + freqold = frequency; + dropout = false; + } + store = true; } if (band == BAND_FM && af != 0 && radio.rds.correctPI != 0) { @@ -2909,6 +2955,7 @@ void DoMemoryPosTune() { memtune = true; memreset = true; rdsflagreset = false; + findMemoryAF = true; ShowFreq(0); } @@ -3001,6 +3048,7 @@ void ShowFreq(int mode) { } else if (mode == 1) { FrequencySprite.fillSprite(BackgroundColor); FrequencySprite.pushSprite(46, 46); + tftPrint(0, myLanguage[language][34], 146, 58, ActiveColor, ActiveColorSmooth, 28); } FrequencySprite.unloadFont(); } diff --git a/src/TEF6686.cpp b/src/TEF6686.cpp index 9a104bc..0949298 100644 --- a/src/TEF6686.cpp +++ b/src/TEF6686.cpp @@ -9,6 +9,13 @@ unsigned long rdstimer = 0; unsigned long bitStartTime = 0; bool lastBitState = false; +uint16_t TEF6686::getBlockA(void) { + uint16_t blockA, dummy; + devTEF_Radio_Get_RDS_Status(&dummy, &blockA, &dummy, &dummy, &dummy, &dummy); + return blockA; +} + + void TEF6686::TestAFEON() { uint16_t status; uint16_t dummy1; @@ -31,7 +38,7 @@ void TEF6686::TestAFEON() { } if (afoffset > -125 || afoffset < 125) { devTEF_Set_Cmd(TEF_FM, Cmd_Tune_To, 7, 4, af[x].frequency); - delay(200); + delay(187); devTEF_Radio_Get_RDS_Status(&rds.rdsStat, &rds.rdsA, &rds.rdsB, &rds.rdsC, &rds.rdsD, &rds.rdsErr); if (rds.rdsStat & (1 << 9)) { @@ -97,7 +104,7 @@ uint16_t TEF6686::TestAF() { if (af_counter != 0 && af[highestIndex].afvalid && af[highestIndex].score > (currentlevel - currentusn - currentwam) && (af[highestIndex].score - (currentlevel - currentusn - currentwam)) >= 70) { devTEF_Set_Cmd(TEF_FM, Cmd_Tune_To, 7, 4, af[highestIndex].frequency); - delay(200); + delay(187); devTEF_Radio_Get_RDS_Status(&rds.rdsStat, &rds.rdsA, &rds.rdsB, &rds.rdsC, &rds.rdsD, &rds.rdsErr); if (rds.rdsStat & (1 << 9)) { if ((afmethodB && rds.afreg ? (((rds.rdsA >> 8) & 0xF) > 2 && ((rds.correctPI >> 8) & 0xF) > 2 && ((rds.rdsA >> 12) & 0xF) == ((rds.correctPI >> 12) & 0xF) && (rds.rdsA & 0xFF) == (rds.correctPI & 0xFF)) || rds.rdsA == rds.correctPI : rds.rdsA == rds.correctPI)) { diff --git a/src/TEF6686.h b/src/TEF6686.h index fd6f8a7..6a2fd09 100644 --- a/src/TEF6686.h +++ b/src/TEF6686.h @@ -708,6 +708,7 @@ class TEF6686 { void setUnMute(); void setVolume(int8_t volume); void tone(uint16_t time, int16_t amplitude, uint16_t frequency); + uint16_t getBlockA(void); String trimTrailingSpaces(String str); uint8_t af_counter; uint8_t eon_counter;