Moved clock to top left of the screen
This commit is contained in:
@@ -2955,6 +2955,7 @@ void BuildDisplay() {
|
||||
tft.drawRect(0, 0, 320, 240, FrameColor);
|
||||
tft.drawLine(0, 30, 320, 30, FrameColor);
|
||||
tft.drawLine(0, 100, 320, 100, FrameColor);
|
||||
tft.drawLine(0, 15, 53, 15, FrameColor);
|
||||
tft.drawLine(120, 30, 120, 0, FrameColor);
|
||||
tft.drawLine(210, 100, 210, 217, FrameColor);
|
||||
tft.drawLine(248, 30, 248, 0, FrameColor);
|
||||
|
||||
+5
-7
@@ -822,7 +822,7 @@ void showCT() {
|
||||
|
||||
// Format the time string with leading zeros for minutes
|
||||
char formattedTime[10];
|
||||
sprintf(formattedTime, "%d:%02d %s", hour, localtime(&t)->tm_min, ampm.c_str());
|
||||
sprintf(formattedTime, "%d:%02d%s", hour, localtime(&t)->tm_min, ampm.c_str());
|
||||
|
||||
rds_clock = String(formattedTime);
|
||||
} else { // Other regions: 24-hour format
|
||||
@@ -841,16 +841,14 @@ void showCT() {
|
||||
}
|
||||
|
||||
// Display the updated time
|
||||
int yCoord = advancedRDS ? 109 : 163;
|
||||
tftReplace(1, rds_clockold, rds_clock, 208, yCoord, RDSColor, RDSColorSmooth, BackgroundColor, 16);
|
||||
tftReplace(0, rds_clockold, rds_clock, 26, 1, RDSColor, RDSColorSmooth, BackgroundColor, 16);
|
||||
} else { // Handle dropout scenarios
|
||||
int yCoord = advancedRDS ? 109 : 163;
|
||||
|
||||
if (rtcset) { // Display dropout message if RTC was set
|
||||
tftReplace(1, rds_clockold, rds_clock, 208, yCoord, RDSDropoutColor, RDSDropoutColorSmooth, BackgroundColor, 16);
|
||||
tftReplace(1, rds_clockold, rds_clock, 26, 1, RDSDropoutColor, RDSDropoutColorSmooth, BackgroundColor, 16);
|
||||
} else { // Clear and reprint the clock
|
||||
tftPrint(1, rds_clockold, 208, yCoord, BackgroundColor, BackgroundColor, 16);
|
||||
tftPrint(1, rds_clock, 208, yCoord, BackgroundColor, BackgroundColor, 16);
|
||||
tftPrint(0, rds_clockold, 26, 1, BackgroundColor, BackgroundColor, 16);
|
||||
tftPrint(0, rds_clock, 26, 1, BackgroundColor, BackgroundColor, 16);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user