You've already forked TEF6686_ESP32
Moved underscore variable to try to avoid memoryleak
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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<wchar_t>(currentChar); break;
|
||||
case 0x5E: output[i] = L'―'; break;
|
||||
case 0x5F: output[i] = L'_'; break;
|
||||
|
||||
@@ -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:
|
||||
|
||||
16
src/gui.cpp
16
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:
|
||||
|
||||
Reference in New Issue
Block a user