Added clock to default screen

This commit is contained in:
Sjef Verhoeven PE5PVB
2023-10-15 00:43:43 +02:00
parent f51bf0cdb0
commit b8b1c8ae9d
4 changed files with 28 additions and 8 deletions
+9 -8
View File
@@ -350,7 +350,7 @@ void BuildAFScreen() {
af_counterold = 254;
strcpy(radioIdPrevious, "");
programServicePrevious = "";
afmethodBold = false;
afmethodBold = false;
for (byte i = 0; i < 11; i++) eonpsold[i] = "";
}
}
@@ -644,11 +644,10 @@ void BuildAdvancedRDS() {
tft.drawCircle(71, 15, 9, SecondaryColor);
}
if (radio.rds.hasCT) tftPrint(1, rds_clockold, 205, 109, SecondaryColor, SecondaryColorSmooth, 16);
tftPrint(-1, "TP", 2, 51, GreyoutColor, BackgroundColor, 16);
tftPrint(-1, "TA", 21, 51, GreyoutColor, BackgroundColor, 16);
tftPrint(-1, "AF", 42, 51, GreyoutColor, BackgroundColor, 16);
tftPrint(-1, "-B", 60, 51, GreyoutColor, BackgroundColor, 16);
tftPrint(-1, "-B", 60, 51, GreyoutColor, BackgroundColor, 16);
tftPrint(-1, "CT", 78, 51, GreyoutColor, BackgroundColor, 16);
tftPrint(-1, "TMC", 95, 51, GreyoutColor, BackgroundColor, 16);
tftPrint(-1, "RT+", 130, 51, GreyoutColor, BackgroundColor, 16);
@@ -695,6 +694,7 @@ void BuildAdvancedRDS() {
afstringold = "";
rtplusstringold = "";
afmethodBold = false;
rds_clockold = "";
ShowMemoryPos();
}
@@ -813,6 +813,7 @@ void BuildDisplay() {
batteryold = 6;
batteryVold = 0;
vPerold = 0;
rds_clockold = "";
strcpy(programTypePrevious, "");
strcpy(radioIdPrevious, "");
programServicePrevious = "";
@@ -1935,11 +1936,11 @@ void DoMenu() {
tftPrint(1, "NoobishSVK", 145, 143, PrimaryColor, PrimaryColorSmooth, 16);
tftPrint(-1, "yo2ldk", 155, 128, PrimaryColor, PrimaryColorSmooth, 16);
tftPrint(-1, "Justin_Peng(Portable)", 155, 143, PrimaryColor, PrimaryColorSmooth, 16);
tftPrint(1, "mx4zxc", 145, 158, PrimaryColor, PrimaryColorSmooth, 16);
tftPrint(-1, "elektronik232", 155, 158, PrimaryColor, PrimaryColorSmooth, 16);
tftPrint(1, "KOTYA8", 145, 173, PrimaryColor, PrimaryColorSmooth, 16);
tftPrint(-1, "mrwish7", 155, 173, PrimaryColor, PrimaryColorSmooth, 16);
tftPrint(1, "lxsxl", 145, 188, PrimaryColor, PrimaryColorSmooth, 16);
tftPrint(1, "mx4zxc", 145, 158, PrimaryColor, PrimaryColorSmooth, 16);
tftPrint(-1, "elektronik232", 155, 158, PrimaryColor, PrimaryColorSmooth, 16);
tftPrint(1, "KOTYA8", 145, 173, PrimaryColor, PrimaryColorSmooth, 16);
tftPrint(-1, "mrwish7", 155, 173, PrimaryColor, PrimaryColorSmooth, 16);
tftPrint(1, "lxsxl", 145, 188, PrimaryColor, PrimaryColorSmooth, 16);
tftPrint(0, "github.com/PE5PVB/TEF6686_ESP32", 155, 208, ActiveColor, ActiveColorSmooth, 16);
break;
}
+15
View File
@@ -725,6 +725,21 @@ void showPS() {
}
}
void showCT() {
if (!screenmute && !afscreen && !advancedRDS) {
rds_clock = ((radio.rds.hour < 10 ? "0" : "") + String(radio.rds.hour) + ":" + (radio.rds.minute < 10 ? "0" : "") + String(radio.rds.minute));
if (rds_clock != rds_clockold) {
if (radio.rds.hasCT) {
tftReplace(1, rds_clockold, rds_clock, 205, 163, PrimaryColor, PrimaryColorSmooth, 16);
Serial.println(rds_clock);
} else {
tftPrint(1, rds_clock, 205, 163, BackgroundColor, BackgroundColor, 16);
}
}
rds_clockold = rds_clock;
}
}
void showRadioText() {
if (radio.rds.hasRT && radio.rds.stationText.length() > 0) {
if (advancedRDS && radio.rds.stationText.length() < 20) {
+1
View File
@@ -120,6 +120,7 @@ void showPTY();
void showPS();
void showRadioText();
void ShowAFEON();
void showCT();
extern void ShowRDSLogo(bool RDSstatus);
extern void DataPrint(String string);