diff --git a/TEF6686_ESP32.ino b/TEF6686_ESP32.ino index 64dd5fe..67bccbf 100644 --- a/TEF6686_ESP32.ino +++ b/TEF6686_ESP32.ino @@ -420,7 +420,7 @@ void setup() { LowLevelSet = EEPROM.readByte(EE_BYTE_LOWLEVELSET); memorypos = EEPROM.readByte(EE_BYTE_MEMORYPOS); region = EEPROM.readByte(EE_BYTE_REGION); - radio.rds.underscore = EEPROM.readByte(EE_BYTE_RDS_UNDERSCORE); + radio.underscore = EEPROM.readByte(EE_BYTE_RDS_UNDERSCORE); USBmode = EEPROM.readByte(EE_BYTE_USBMODE); wifi = EEPROM.readByte(EE_BYTE_WIFI); subnetclient = EEPROM.readByte(EE_BYTE_SUBNETCLIENT); @@ -1919,7 +1919,7 @@ void ModeButtonPress() { EEPROM.writeByte(EE_BYTE_SHOWRDSERRORS, showrdserrors); EEPROM.writeByte(EE_BYTE_LOWLEVELSET, LowLevelSet); EEPROM.writeByte(EE_BYTE_REGION, region); - EEPROM.writeByte(EE_BYTE_RDS_UNDERSCORE, radio.rds.underscore); + EEPROM.writeByte(EE_BYTE_RDS_UNDERSCORE, radio.underscore); EEPROM.writeByte(EE_BYTE_USBMODE, USBmode); EEPROM.writeByte(EE_BYTE_WIFI, wifi); EEPROM.writeByte(EE_BYTE_SUBNETCLIENT, subnetclient); diff --git a/src/TEF6686.cpp b/src/TEF6686.cpp index b94714a..5ba0983 100644 --- a/src/TEF6686.cpp +++ b/src/TEF6686.cpp @@ -1720,7 +1720,7 @@ String TEF6686::extractUTF8Substring(const String & utf8String, size_t start, si charIndex++; } - if (under && rds.underscore) { + if (under && underscore) { while (substring.length() < length) { substring += '_'; } @@ -1734,7 +1734,7 @@ void TEF6686::RDScharConverter(const char* input, wchar_t* output, size_t size, for (size_t i = 0; i < size - 1; i++) { char currentChar = input[i]; switch (currentChar) { - case 0x20: if (under && rds.underscore) output[i] = L'_'; else output[i] = L' '; break; + case 0x20: if (under && underscore) output[i] = L'_'; else output[i] = L' '; break; case 0x21 ... 0x5D: output[i] = static_cast(currentChar); break; case 0x5E: output[i] = L'―'; break; case 0x5F: output[i] = L'_'; break; diff --git a/src/TEF6686.h b/src/TEF6686.h index c1f5142..51cca4d 100644 --- a/src/TEF6686.h +++ b/src/TEF6686.h @@ -610,7 +610,6 @@ typedef struct _rds_ { bool rtAB32; bool hasRDSplus; bool filter; - bool underscore; bool rdsreset; bool pierrors; bool sortaf; @@ -670,7 +669,7 @@ class TEF6686 { void setSoftmuteAM(uint8_t mode); void setMono(bool mono); bool getStereoStatus(); - void setCoax(uint8_t mode); + void setCoax(uint8_t mode); void init(byte TEF); void clearRDS(bool fullsearchrds); void power(bool mode); @@ -707,6 +706,7 @@ class TEF6686 { uint8_t rdsblock; bool mute; bool afmethodB; + bool underscore; byte af_updatecounter; private: diff --git a/src/gui.cpp b/src/gui.cpp index 90e1030..6e3e6ae 100644 --- a/src/gui.cpp +++ b/src/gui.cpp @@ -611,7 +611,7 @@ void BuildMenu() { if (region == REGION_EU) tftPrint(1, myLanguage[language][47], 310, ITEM2 + 6, PrimaryColor, PrimaryColorSmooth, 16); if (region == REGION_US) tftPrint(1, myLanguage[language][48], 310, ITEM2 + 6, PrimaryColor, PrimaryColorSmooth, 16); - if (radio.rds.underscore) tftPrint(1, myLanguage[language][42], 310, ITEM3 + 6, PrimaryColor, PrimaryColorSmooth, 16); else tftPrint(1, myLanguage[language][30], 310, ITEM3 + 6, PrimaryColor, PrimaryColorSmooth, 16); + if (radio.underscore) tftPrint(1, myLanguage[language][42], 310, ITEM3 + 6, PrimaryColor, PrimaryColorSmooth, 16); else tftPrint(1, myLanguage[language][30], 310, ITEM3 + 6, PrimaryColor, PrimaryColorSmooth, 16); if (radio.rds.filter) tftPrint(1, myLanguage[language][42], 310, ITEM4 + 6, PrimaryColor, PrimaryColorSmooth, 16); else tftPrint(1, myLanguage[language][30], 310, ITEM4 + 6, PrimaryColor, PrimaryColorSmooth, 16); if (radio.rds.pierrors) tftPrint(1, myLanguage[language][42], 310, ITEM5 + 6, PrimaryColor, PrimaryColorSmooth, 16); else tftPrint(1, myLanguage[language][30], 310, ITEM5 + 6, PrimaryColor, PrimaryColorSmooth, 16); @@ -1283,9 +1283,9 @@ void MenuUp() { break; case ITEM3: - if (radio.rds.underscore) tftPrint(0, myLanguage[language][42], 155, 118, BackgroundColor, BackgroundColor, 28); else tftPrint(0, myLanguage[language][30], 155, 118, BackgroundColor, BackgroundColor, 28); - if (radio.rds.underscore) radio.rds.underscore = false; else radio.rds.underscore = true; - if (radio.rds.underscore) tftPrint(0, myLanguage[language][42], 155, 118, PrimaryColor, PrimaryColorSmooth, 28); else tftPrint(0, myLanguage[language][30], 155, 118, PrimaryColor, PrimaryColorSmooth, 28); + if (radio.underscore) tftPrint(0, myLanguage[language][42], 155, 118, BackgroundColor, BackgroundColor, 28); else tftPrint(0, myLanguage[language][30], 155, 118, BackgroundColor, BackgroundColor, 28); + if (radio.underscore) radio.underscore = false; else radio.underscore = true; + if (radio.underscore) tftPrint(0, myLanguage[language][42], 155, 118, PrimaryColor, PrimaryColorSmooth, 28); else tftPrint(0, myLanguage[language][30], 155, 118, PrimaryColor, PrimaryColorSmooth, 28); break; case ITEM4: @@ -1881,9 +1881,9 @@ void MenuDown() { break; case ITEM3: - if (radio.rds.underscore) tftPrint(0, myLanguage[language][42], 155, 118, BackgroundColor, BackgroundColor, 28); else tftPrint(0, myLanguage[language][30], 155, 118, BackgroundColor, BackgroundColor, 28); - if (radio.rds.underscore) radio.rds.underscore = false; else radio.rds.underscore = true; - if (radio.rds.underscore) tftPrint(0, myLanguage[language][42], 155, 118, PrimaryColor, PrimaryColorSmooth, 28); else tftPrint(0, myLanguage[language][30], 155, 118, PrimaryColor, PrimaryColorSmooth, 28); + if (radio.underscore) tftPrint(0, myLanguage[language][42], 155, 118, BackgroundColor, BackgroundColor, 28); else tftPrint(0, myLanguage[language][30], 155, 118, BackgroundColor, BackgroundColor, 28); + if (radio.underscore) radio.underscore = false; else radio.underscore = true; + if (radio.underscore) tftPrint(0, myLanguage[language][42], 155, 118, PrimaryColor, PrimaryColorSmooth, 28); else tftPrint(0, myLanguage[language][30], 155, 118, PrimaryColor, PrimaryColorSmooth, 28); break; case ITEM4: @@ -2450,7 +2450,7 @@ void DoMenu() { case ITEM3: Infoboxprint(myLanguage[language][49]); - if (radio.rds.underscore) tftPrint(0, myLanguage[language][42], 155, 118, PrimaryColor, PrimaryColorSmooth, 28); else tftPrint(0, myLanguage[language][30], 155, 118, PrimaryColor, PrimaryColorSmooth, 28); + if (radio.underscore) tftPrint(0, myLanguage[language][42], 155, 118, PrimaryColor, PrimaryColorSmooth, 28); else tftPrint(0, myLanguage[language][30], 155, 118, PrimaryColor, PrimaryColorSmooth, 28); break; case ITEM4: