Won 105kB flash by optimising UI text handling

This commit is contained in:
Sjef Verhoeven PE5PVB
2025-06-06 17:00:28 +02:00
parent c85a5a0086
commit 0694726b8b
12 changed files with 776 additions and 765 deletions
+47 -37
View File
@@ -448,6 +448,8 @@ unsigned long tottimer;
unsigned long tuningtimer;
unsigned long udplogtimer;
unsigned long udptimer;
const size_t language_totalnumber = sizeof(myLanguage) / sizeof(myLanguage[0]);
const size_t language_entrynumber = sizeof(myLanguage[0]) / sizeof(myLanguage[0][0]);
struct HSV {
float h;
@@ -747,8 +749,8 @@ void setup() {
EEPROM.writeByte(EE_BYTE_ROTARYMODE, rotarymode);
EEPROM.commit();
analogWrite(CONTRASTPIN, map(ContrastSet, 0, 100, 15, 255));
Infoboxprint(myLanguage[language][1]);
tftPrint(0, myLanguage[language][2], 155, 130, ActiveColor, ActiveColorSmooth, 28);
Infoboxprint(textUI(1));
tftPrint(0, textUI(2), 155, 130, ActiveColor, ActiveColorSmooth, 28);
while (digitalRead(BWBUTTON) == LOW) delay(50);
}
@@ -771,16 +773,16 @@ void setup() {
EEPROM.writeByte(EE_BYTE_DISPLAYFLIP, displayflip);
EEPROM.commit();
analogWrite(CONTRASTPIN, map(ContrastSet, 0, 100, 15, 255));
Infoboxprint(myLanguage[language][3]);
tftPrint(0, myLanguage[language][2], 155, 130, ActiveColor, ActiveColorSmooth, 28);
Infoboxprint(textUI(3));
tftPrint(0, textUI(2), 155, 130, ActiveColor, ActiveColorSmooth, 28);
while (digitalRead(MODEBUTTON) == LOW) delay(50);
}
if (digitalRead(BWBUTTON) == HIGH && digitalRead(ROTARY_BUTTON) == HIGH && digitalRead(MODEBUTTON) == HIGH && digitalRead(BANDBUTTON) == LOW) {
analogWrite(SMETERPIN, 511);
analogWrite(CONTRASTPIN, map(ContrastSet, 0, 100, 15, 255));
Infoboxprint(myLanguage[language][4]);
tftPrint(0, myLanguage[language][2], 155, 130, ActiveColor, ActiveColorSmooth, 28);
Infoboxprint(textUI(4));
tftPrint(0, textUI(2), 155, 130, ActiveColor, ActiveColorSmooth, 28);
while (digitalRead(BANDBUTTON) == LOW) delay(50);
analogWrite(SMETERPIN, 0);
}
@@ -789,30 +791,30 @@ void setup() {
analogWrite(CONTRASTPIN, map(ContrastSet, 0, 100, 15, 255));
if (optenc == 0) {
optenc = 1;
Infoboxprint(myLanguage[language][6]);
Infoboxprint(textUI(6));
} else {
optenc = 0;
Infoboxprint(myLanguage[language][7]);
Infoboxprint(textUI(7));
}
EEPROM.writeByte(EE_BYTE_OPTENC, optenc);
EEPROM.commit();
tftPrint(0, myLanguage[language][2], 155, 130, ActiveColor, ActiveColorSmooth, 28);
tftPrint(0, textUI(2), 155, 130, ActiveColor, ActiveColorSmooth, 28);
while (digitalRead(ROTARY_BUTTON) == LOW) delay(50);
}
if (digitalRead(BWBUTTON) == LOW && digitalRead(ROTARY_BUTTON) == LOW && digitalRead(MODEBUTTON) == HIGH && digitalRead(BANDBUTTON) == HIGH) {
analogWrite(CONTRASTPIN, map(ContrastSet, 0, 100, 15, 255));
DefaultSettings();
Infoboxprint(myLanguage[language][66]);
tftPrint(0, myLanguage[language][2], 155, 130, ActiveColor, ActiveColorSmooth, 28);
Infoboxprint(textUI(66));
tftPrint(0, textUI(2), 155, 130, ActiveColor, ActiveColorSmooth, 28);
while (digitalRead(ROTARY_BUTTON) == LOW && digitalRead(BWBUTTON) == LOW) delay(50);
ESP.restart();
}
if (digitalRead(BWBUTTON) == LOW && digitalRead(ROTARY_BUTTON) == HIGH && digitalRead(MODEBUTTON) == LOW && digitalRead(BANDBUTTON) == HIGH) {
analogWrite(CONTRASTPIN, map(ContrastSet, 0, 100, 15, 255));
Infoboxprint(myLanguage[language][282]);
tftPrint(0, myLanguage[language][283], 155, 100, ActiveColor, ActiveColorSmooth, 28);
Infoboxprint(textUI(282));
tftPrint(0, textUI(283), 155, 100, ActiveColor, ActiveColorSmooth, 28);
tft.calibrateTouch(TouchCalData, PrimaryColor, BackgroundColor, 30);
EEPROM.writeUInt(EE_UINT16_CALTOUCH1, TouchCalData[0]);
EEPROM.writeUInt(EE_UINT16_CALTOUCH2, TouchCalData[1]);
@@ -824,8 +826,8 @@ void setup() {
if (digitalRead(BWBUTTON) == LOW && digitalRead(ROTARY_BUTTON) == HIGH && digitalRead(MODEBUTTON) == HIGH && digitalRead(BANDBUTTON) == LOW) {
analogWrite(CONTRASTPIN, map(ContrastSet, 0, 100, 15, 255));
Infoboxprint(myLanguage[language][69]);
tftPrint(0, myLanguage[language][2], 155, 130, ActiveColor, ActiveColorSmooth, 28);
Infoboxprint(textUI(69));
tftPrint(0, textUI(2), 155, 130, ActiveColor, ActiveColorSmooth, 28);
invertdisplay = !invertdisplay;
tft.invertDisplay(!invertdisplay);
while (digitalRead(BWBUTTON) == LOW && digitalRead(BANDBUTTON) == LOW) delay(50);
@@ -836,7 +838,7 @@ void setup() {
tft.setTouch(TouchCalData);
tft.fillScreen(BackgroundColor);
tftPrint(0, myLanguage[language][8], 160, 3, PrimaryColor, PrimaryColorSmooth, 28);
tftPrint(0, textUI(8), 160, 3, PrimaryColor, PrimaryColorSmooth, 28);
tftPrint(0, "Software " + String(VERSION), 160, 152, PrimaryColor, PrimaryColorSmooth, 16);
tft.fillRect(120, 230, 16, 6, GreyoutColor);
@@ -888,7 +890,7 @@ void setup() {
tft.fillRect(152, 230, 16, 6, PrimaryColor);
tftPrint(0, "TEF6689 Lithio FMSI DR", 160, 172, ActiveColor, ActiveColorSmooth, 28);
} else {
tftPrint(0, myLanguage[language][9], 160, 172, SignificantColor, SignificantColorSmooth, 28);
tftPrint(0, textUI(9), 160, 172, SignificantColor, SignificantColorSmooth, 28);
tft.fillRect(152, 230, 16, 6, SignificantColor);
while (true);
for (;;);
@@ -1118,7 +1120,7 @@ void loop() {
if (advancedRDS) {
tft.drawRoundRect(10, 30, 300, 170, 2, ActiveColor);
tft.fillRoundRect(12, 32, 296, 166, 2, BackgroundColor);
tftPrint(0, myLanguage[language][34], 160, 100, ActiveColor, ActiveColorSmooth, 28);
tftPrint(0, textUI(34), 160, 100, ActiveColor, ActiveColorSmooth, 28);
} else {
ShowFreq(1);
}
@@ -2453,25 +2455,25 @@ void SelectBand() {
ShowTuneMode();
ShowStepSize();
tftPrint(-1, myLanguage[language][102], 70, 32, BackgroundColor, BackgroundColor, 16);
tftPrint(-1, myLanguage[language][103], 70, 32, BackgroundColor, BackgroundColor, 16);
tftPrint(-1, myLanguage[language][104], 70, 32, BackgroundColor, BackgroundColor, 16);
tftPrint(-1, myLanguage[language][105], 70, 32, BackgroundColor, BackgroundColor, 16);
tftPrint(-1, myLanguage[language][106], 70, 32, BackgroundColor, BackgroundColor, 16);
tftPrint(-1, textUI(102), 70, 32, BackgroundColor, BackgroundColor, 16);
tftPrint(-1, textUI(103), 70, 32, BackgroundColor, BackgroundColor, 16);
tftPrint(-1, textUI(104), 70, 32, BackgroundColor, BackgroundColor, 16);
tftPrint(-1, textUI(105), 70, 32, BackgroundColor, BackgroundColor, 16);
tftPrint(-1, textUI(106), 70, 32, BackgroundColor, BackgroundColor, 16);
#ifdef HAS_AIR_BAND
tftPrint(-1, myLanguage[language][223], 70, 32, BackgroundColor, BackgroundColor, 16);
tftPrint(-1, textUI(223), 70, 32, BackgroundColor, BackgroundColor, 16);
#endif
switch (band) {
case BAND_LW: tftPrint(-1, myLanguage[language][102], 70, 32, (bandforbidden ? GreyoutColor : PrimaryColor), (bandforbidden ? BackgroundColor : PrimaryColorSmooth), 16); break;
case BAND_MW: tftPrint(-1, myLanguage[language][103], 70, 32, (bandforbidden ? GreyoutColor : PrimaryColor), (bandforbidden ? BackgroundColor : PrimaryColorSmooth), 16); break;
case BAND_SW: tftPrint(-1, myLanguage[language][104], 70, 32, (bandforbidden ? GreyoutColor : PrimaryColor), (bandforbidden ? BackgroundColor : PrimaryColorSmooth), 16); break;
case BAND_FM: tftPrint(-1, myLanguage[language][105], 70, 32, (bandforbidden ? GreyoutColor : PrimaryColor), (bandforbidden ? BackgroundColor : PrimaryColorSmooth), 16); break;
case BAND_OIRT: tftPrint(-1, myLanguage[language][106], 70, 32, (bandforbidden ? GreyoutColor : PrimaryColor), (bandforbidden ? BackgroundColor : PrimaryColorSmooth), 16); break;
case BAND_LW: tftPrint(-1, textUI(102), 70, 32, (bandforbidden ? GreyoutColor : PrimaryColor), (bandforbidden ? BackgroundColor : PrimaryColorSmooth), 16); break;
case BAND_MW: tftPrint(-1, textUI(103), 70, 32, (bandforbidden ? GreyoutColor : PrimaryColor), (bandforbidden ? BackgroundColor : PrimaryColorSmooth), 16); break;
case BAND_SW: tftPrint(-1, textUI(104), 70, 32, (bandforbidden ? GreyoutColor : PrimaryColor), (bandforbidden ? BackgroundColor : PrimaryColorSmooth), 16); break;
case BAND_FM: tftPrint(-1, textUI(105), 70, 32, (bandforbidden ? GreyoutColor : PrimaryColor), (bandforbidden ? BackgroundColor : PrimaryColorSmooth), 16); break;
case BAND_OIRT: tftPrint(-1, textUI(106), 70, 32, (bandforbidden ? GreyoutColor : PrimaryColor), (bandforbidden ? BackgroundColor : PrimaryColorSmooth), 16); break;
#ifdef HAS_AIR_BAND
case BAND_AIR: tftPrint(-1, myLanguage[language][223], 70, 32, (bandforbidden ? GreyoutColor : PrimaryColor), (bandforbidden ? BackgroundColor : PrimaryColorSmooth), 16); break;
case BAND_AIR: tftPrint(-1, textUI(223), 70, 32, (bandforbidden ? GreyoutColor : PrimaryColor), (bandforbidden ? BackgroundColor : PrimaryColorSmooth), 16); break;
#endif
}
}
@@ -3247,11 +3249,11 @@ void ShowFreq(int mode) {
freqold = freq;
break;
case 1: Infoboxprint(myLanguage[language][34]); break;
case 2: Infoboxprint(myLanguage[language][290]); break;
case 3: Infoboxprint(myLanguage[language][291]); break;
case 4: Infoboxprint(myLanguage[language][295]); break;
case 5: Infoboxprint(myLanguage[language][284]); break;
case 1: Infoboxprint(textUI(34)); break;
case 2: Infoboxprint(textUI(290)); break;
case 3: Infoboxprint(textUI(291)); break;
case 4: Infoboxprint(textUI(295)); break;
case 5: Infoboxprint(textUI(284)); break;
}
FrequencySprite.pushSprite(46, 46);
@@ -4459,7 +4461,7 @@ void SetTunerPatch() {
analogWrite(CONTRASTPIN, map(ContrastSet, 0, 100, 15, 255));
if (TEF != 102 && TEF != 205) {
tftPrint(0, myLanguage[language][35], 150, 78, ActiveColor, ActiveColorSmooth, 28);
tftPrint(0, textUI(35), 150, 78, ActiveColor, ActiveColorSmooth, 28);
for (;;);
}
EEPROM.writeByte(EE_BYTE_TEF, TEF);
@@ -5100,7 +5102,7 @@ uint8_t doAutoMemory(uint16_t startfreq, uint16_t stopfreq, uint8_t startmem, ui
tft.drawRect(59, 109, 202, 8, FrameColor);
tft.fillRect(60, 110, 200, 6, GreyoutColor);
tftPrint(1, myLanguage[language][272], 120, 155, ActiveColor, ActiveColorSmooth, 16);
tftPrint(1, textUI(272), 120, 155, ActiveColor, ActiveColorSmooth, 16);
for (frequency = startfreq * 10; frequency <= stopfreq * 10; frequency += 10) {
if (stopScanning) {
@@ -5563,3 +5565,11 @@ uint16_t HSVtoRGB565(float h, float s, float v) {
return ((r & 0xF8) << 8) | ((g & 0xFC) << 3) | (b >> 3);
}
const char* textUI(uint16_t number) {
if (number >= language_entrynumber) {
return "Overflow";
} else {
return (const char*)pgm_read_ptr(&(myLanguage[language][number]));
}
}
+4 -5
View File
@@ -1,5 +1,4 @@
#include "comms.h"
#include "language.h"
#include "constants.h"
#include <EEPROM.h>
@@ -805,7 +804,7 @@ void XDRGTKRoutine() {
if (!screenmute) {
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);
tftPrint(0, textUI(34), 160, 100, ActiveColor, ActiveColorSmooth, 28);
}
DataPrint("U");
@@ -974,7 +973,7 @@ void tryWiFi() {
if (!setupmode && wifi) {
tft.drawRoundRect(1, 20, 319, 180, 5, ActiveColor);
tft.fillRoundRect(3, 22, 315, 176, 5, BackgroundColor);
Infoboxprint(myLanguage[language][55]);
Infoboxprint(textUI(55));
}
if (wifi) {
if (wc.autoConnect()) {
@@ -986,9 +985,9 @@ void tryWiFi() {
webserver.begin();
NTPupdate();
remoteip = IPAddress (WiFi.localIP()[0], WiFi.localIP()[1], WiFi.localIP()[2], subnetclient);
if (!setupmode) tftPrint(0, myLanguage[language][57], 155, 128, InsignificantColor, InsignificantColorSmooth, 28);
if (!setupmode) tftPrint(0, textUI(57), 155, 128, InsignificantColor, InsignificantColorSmooth, 28);
} else {
if (!setupmode) tftPrint(0, myLanguage[language][56], 155, 128, SignificantColor, SignificantColorSmooth, 28);
if (!setupmode) tftPrint(0, textUI(56), 155, 128, SignificantColor, SignificantColorSmooth, 28);
Server.end();
webserver.stop();
Udp.stop();
+1
View File
@@ -158,4 +158,5 @@ extern void Infoboxprint(const char* input);
extern void TuneUp();
extern void TuneDown();
extern void ShowTuneMode();
extern const char* textUI(uint16_t number);
#endif
+2
View File
@@ -1,6 +1,8 @@
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-variable"
#define VERSION "v2.20"
#define ON 1
#define OFF 0
#define REVERSE false
+703 -704
View File
File diff suppressed because it is too large Load Diff
+2
View File
@@ -207,6 +207,7 @@ extern unsigned int memstartfreq;
extern unsigned int memstopfreq;
extern unsigned long scantimer;
extern byte items[10];
extern const size_t language_totalnumber;
extern TFT_eSPI tft;
extern TEF6686 radio;
@@ -255,4 +256,5 @@ extern void showAutoSquelch(bool mode);
extern uint8_t doAutoMemory(uint16_t startfreq, uint16_t stopfreq, uint8_t startmem, uint8_t stopmem, bool rdsonly, uint8_t doublepi);
extern void ClearMemoryRange(uint8_t start, uint8_t stop);
extern bool handleCreateNewLogbook();
extern const char* textUI(uint16_t number);
#endif
-2
View File
@@ -1,8 +1,6 @@
#ifndef LANGUAGE_H
#define LANGUAGE_H
#define VERSION "v2.20"
// [number of languages][number of texts]
static const char* const myLanguage[21][301] PROGMEM = {
+5 -6
View File
@@ -1,5 +1,4 @@
#include "logbook.h"
#include "language.h"
#include "constants.h"
#include <EEPROM.h>
@@ -45,9 +44,9 @@ void handleRoot() {
html += "<img src=\"/logo.png\" alt=\"FMDX website\">";
html += "</a>";
html += "<h1>" + String(myLanguage[language][286]) + "</h1>";
html += "<button onclick=\"window.location.href='/downloadCSV'\">" + String(myLanguage[language][287]) + "</button>";
html += "<button class=\"go-to-bottom\" onclick=\" window.scrollTo(0, document.body.scrollHeight);\">" + String(myLanguage[language][289]) + "</button>";
html += "<h1>" + String(textUI(286)) + "</h1>";
html += "<button onclick=\"window.location.href='/downloadCSV'\">" + String(textUI(287)) + "</button>";
html += "<button class=\"go-to-bottom\" onclick=\" window.scrollTo(0, document.body.scrollHeight);\">" + String(textUI(289)) + "</button>";
// Sorting function with icons
html += "<script>";
@@ -151,11 +150,11 @@ void handleRoot() {
file.close();
} else {
html += "<tr><td colspan=\"100%\" style=\"text-align: center; color: red;\">" + String(myLanguage[language][299]) + "</td></tr>";
html += "<tr><td colspan=\"100%\" style=\"text-align: center; color: red;\">" + String(textUI(299)) + "</td></tr>";
}
if (!hasData) {
html += "<tr><td colspan=\"100%\" style=\"text-align: center; color: red;\">" + String(myLanguage[language][288]) + "</td></tr>";
html += "<tr><td colspan=\"100%\" style=\"text-align: center; color: red;\">" + String(textUI(288)) + "</td></tr>";
}
html += "</table>";
+2
View File
@@ -40,4 +40,6 @@ void handleLogo();
void printLogbookCSV();
void sendUDPlog();
IPAddress makeBroadcastAddress(IPAddress ip);
extern const char* textUI(uint16_t number);
#endif
+9 -10
View File
@@ -1,7 +1,6 @@
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wbool-compare"
#include "rds.h"
#include "language.h"
#include "constants.h"
#include <TimeLib.h>
@@ -51,7 +50,7 @@ void ShowAdvancedRDS() {
if (licold != radio.rds.LIC || rdsreset) {
if (!screenmute) {
if (radio.rds.hasLIC) LICString = (radio.rds.LICtext.length() == 0 ? myLanguage[language][73] : radio.rds.LICtext); else LICString = "N/A";
if (radio.rds.hasLIC) LICString = (radio.rds.LICtext.length() == 0 ? textUI(73) : radio.rds.LICtext); else LICString = "N/A";
if (LICString != LIColdString) {
tftPrint(-1, "N/A", 242, 208, BackgroundColor, BackgroundColor, 16);
tftPrint(-1, LIColdString, 242, 208, BackgroundColor, BackgroundColor, 16);
@@ -74,7 +73,7 @@ void ShowAdvancedRDS() {
}
String afstring;
if (radio.rds.hasAF && radio.af_counter > 0) for (byte i = 0; i < radio.af_counter; i++) afstring += String(radio.af[i].frequency / 100) + "." + String((radio.af[i].frequency % 100) / 10) + (i == radio.af_counter - 1 ? " " : " | "); else afstring = myLanguage[language][87];
if (radio.rds.hasAF && radio.af_counter > 0) for (byte i = 0; i < radio.af_counter; i++) afstring += String(radio.af[i].frequency / 100) + "." + String((radio.af[i].frequency % 100) / 10) + (i == radio.af_counter - 1 ? " " : " | "); else afstring = textUI(87);
if (hasafold != radio.rds.hasAF) {
if (!screenmute) {
if (radio.rds.hasAF) tftPrint(-1, "AF", 50, 51, RDSColor, RDSColorSmooth, 16); else tftPrint(-1, "AF", 50, 51, GreyoutColor, BackgroundColor, 16);
@@ -115,7 +114,7 @@ void ShowAdvancedRDS() {
}
String eonstring;
if (radio.eon_counter > 0) for (byte i = 0; i < radio.eon_counter; i++) eonstring += String(radio.eon[i].picode) + (radio.eon[i].ps.length() > 0 ? String(": " + String(radio.eon[i].ps)) : "") + (radio.eon[i].mappedfreq > 0 ? String(" " + String(radio.eon[i].mappedfreq / 100) + "." + String((radio.eon[i].mappedfreq % 100) / 10)) : "") + (radio.eon[i].mappedfreq2 > 0 ? String(" / " + String(radio.eon[i].mappedfreq2 / 100) + "." + String((radio.eon[i].mappedfreq2 % 100) / 10)) : "") + (radio.eon[i].mappedfreq3 > 0 ? String(" / " + String(radio.eon[i].mappedfreq3 / 100) + "." + String((radio.eon[i].mappedfreq3 % 100) / 10)) : "") + (i == radio.eon_counter - 1 ? " " : " | "); else eonstring = myLanguage[language][88];
if (radio.eon_counter > 0) for (byte i = 0; i < radio.eon_counter; i++) eonstring += String(radio.eon[i].picode) + (radio.eon[i].ps.length() > 0 ? String(": " + String(radio.eon[i].ps)) : "") + (radio.eon[i].mappedfreq > 0 ? String(" " + String(radio.eon[i].mappedfreq / 100) + "." + String((radio.eon[i].mappedfreq % 100) / 10)) : "") + (radio.eon[i].mappedfreq2 > 0 ? String(" / " + String(radio.eon[i].mappedfreq2 / 100) + "." + String((radio.eon[i].mappedfreq2 % 100) / 10)) : "") + (radio.eon[i].mappedfreq3 > 0 ? String(" / " + String(radio.eon[i].mappedfreq3 / 100) + "." + String((radio.eon[i].mappedfreq3 % 100) / 10)) : "") + (i == radio.eon_counter - 1 ? " " : " | "); else eonstring = textUI(88);
if (haseonold != radio.rds.hasEON) {
if (!screenmute) {
if (radio.eon_counter > 0) tftPrint(-1, "EON", 153, 51, RDSColor, RDSColorSmooth, 16); else tftPrint(-1, "EON", 153, 51, GreyoutColor, BackgroundColor, 16);
@@ -156,7 +155,7 @@ void ShowAdvancedRDS() {
}
String rtplusstring;
if (radio.rds.hasRDSplus) rtplusstring = (radio.rds.rdsplusTag1 != 169 ? String(myLanguage[language][radio.rds.rdsplusTag1]) + ": " + String(radio.rds.RTContent1) : "") + (radio.rds.rdsplusTag2 != 169 ? " - " + String(myLanguage[language][radio.rds.rdsplusTag2]) + ": " + String(radio.rds.RTContent2) : "") + " "; else rtplusstring = myLanguage[language][89];
if (radio.rds.hasRDSplus) rtplusstring = (radio.rds.rdsplusTag1 != 169 ? String(textUI(radio.rds.rdsplusTag1)) + ": " + String(radio.rds.RTContent1) : "") + (radio.rds.rdsplusTag2 != 169 ? " - " + String(textUI(radio.rds.rdsplusTag2)) + ": " + String(radio.rds.RTContent2) : "") + " "; else rtplusstring = textUI(89);
if (hasrtplusold != radio.rds.hasRDSplus) {
if (!screenmute) {
if (radio.rds.hasRDSplus) tftPrint(-1, "RT+", 123, 51, RDSColor, RDSColorSmooth, 16); else tftPrint(-1, "RT+", 123, 51, GreyoutColor, BackgroundColor, 16);
@@ -281,7 +280,7 @@ void showECC() {
if (ECCold != radio.rds.ECC) {
if (advancedRDS) {
if (!screenmute) {
if (radio.rds.hasECC) ECCString = (radio.rds.ECCtext.length() == 0 ? myLanguage[language][73] : radio.rds.ECCtext); else ECCString = "N/A";
if (radio.rds.hasECC) ECCString = (radio.rds.ECCtext.length() == 0 ? textUI(73) : radio.rds.ECCtext); else ECCString = "N/A";
if (ECCString != ECColdString) {
tftPrint(-1, "N/A", 242, 193, BackgroundColor, BackgroundColor, 16);
tftPrint(-1, ECColdString, 242, 193, BackgroundColor, BackgroundColor, 16);
@@ -617,7 +616,7 @@ void showPI() {
void showPTY() {
if (strcmp(radio.rds.stationType, programTypePrevious)) {
String PTYString = String(radio.rds.stationTypeCode) + "/" + (radio.rds.region != 0 ? radio.rds.stationType : myLanguage[language][228 + radio.rds.stationTypeCode]);
String PTYString = String(radio.rds.stationTypeCode) + "/" + (radio.rds.region != 0 ? radio.rds.stationType : textUI(228 + radio.rds.stationTypeCode));
if (radio.rds.stationTypeCode == 32) PTYString = "";
@@ -1002,7 +1001,7 @@ void ShowAFEON() {
if (radio.rds.hasAF && afpagenr == 1) {
if (!hasafold) {
tftPrint(-1, myLanguage[language][87], 6, 48, BackgroundColor, BackgroundColor, 16);
tftPrint(-1, textUI(87), 6, 48, BackgroundColor, BackgroundColor, 16);
tftPrint(-1, "AF:", 4, 32, ActiveColor, ActiveColorSmooth, 16);
hasafold = true;
}
@@ -1029,7 +1028,7 @@ void ShowAFEON() {
if (radio.eon_counter > 0 && afpagenr > 1) {
if (!haseonold) {
tftPrint(-1, myLanguage[language][88], 6, 48, BackgroundColor, BackgroundColor, 16);
tftPrint(-1, textUI(88), 6, 48, BackgroundColor, BackgroundColor, 16);
tftPrint(-1, "PI", 4, 32, ActiveColor, ActiveColorSmooth, 16);
tftPrint(0, "TA", 250, 32, ActiveColor, ActiveColorSmooth, 16);
tftPrint(0, "TP", 276, 32, ActiveColor, ActiveColorSmooth, 16);
@@ -1194,7 +1193,7 @@ void ShowAFEON() {
aid_counterold = radio.rds.aid_counter;
if (AIDStringTemp != AIDStringold) {
AIDString = String(myLanguage[language][33]) + " - " + String(myLanguage[language][79]) + ": " + AIDStringTemp + " ";
AIDString = String(textUI(33)) + " - " + String(textUI(79)) + ": " + AIDStringTemp + " ";
AIDWidth = FullLineSprite.textWidth(AIDString);
AIDStringold = AIDString;
}
+1
View File
@@ -158,4 +158,5 @@ extern void DataPrint(String string);
extern void tftPrint(int8_t offset, const String & text, int16_t x, int16_t y, int color, int smoothcolor, uint8_t fontsize);
extern void tftReplace(int8_t offset, const String & textold, const String & text, int16_t x, int16_t y, int color, int smoothcolor, int background, uint8_t fontsize);
extern bool isDST(time_t t);
extern const char* textUI(uint16_t number);
#endif
-1
View File
@@ -1,5 +1,4 @@
#include "touch.h"
#include "language.h"
#include "constants.h"
#include <EEPROM.h>