You've already forked TEF6686_ESP32
Update speaker icon and added date
This commit is contained in:
@@ -732,7 +732,7 @@ void XDRGTKRoutine() {
|
||||
|
||||
case '\0':
|
||||
radio.setMute();
|
||||
if (!screenmute) tft.drawBitmap(253, 140, Speaker, 26, 22, PrimaryColor);
|
||||
if (!screenmute && !afscreen) tft.drawBitmap((advancedRDS ? 215 : 253), (advancedRDS ? 45: 140), Speaker, 21, 20, PrimaryColor);
|
||||
if (!screenmute) {
|
||||
tft.drawRoundRect(10, 30, 300, 170, 5, ActiveColor);
|
||||
tft.fillRoundRect(12, 32, 296, 166, 5, BackgroundColor);
|
||||
@@ -761,7 +761,7 @@ void XDRGTKRoutine() {
|
||||
XDRScan = false;
|
||||
if (VolSet != 0) {
|
||||
radio.setUnMute();
|
||||
if (!screenmute) tft.drawBitmap(253, 140, Speaker, 26, 22, GreyoutColor);
|
||||
if (!screenmute && !afscreen) tft.drawBitmap((advancedRDS ? 215 : 253), (advancedRDS ? 45: 140), Speaker, 21, 20, GreyoutColor);
|
||||
radio.setVolume(((VolSet * 10) - 40) / 10);
|
||||
}
|
||||
break;
|
||||
@@ -799,12 +799,12 @@ void XDRGTKRoutine() {
|
||||
VolSet = atoi(buff + 1);
|
||||
if (VolSet == 0) {
|
||||
radio.setMute();
|
||||
if (!screenmute) tft.drawBitmap(253, 140, Speaker, 26, 22, PrimaryColor);
|
||||
if (!screenmute && !afscreen) tft.drawBitmap((advancedRDS ? 215 : 253), (advancedRDS ? 45: 140), Speaker, 21, 20, PrimaryColor);
|
||||
XDRMute = true;
|
||||
SQ = true;
|
||||
} else {
|
||||
radio.setUnMute();
|
||||
if (!screenmute) tft.drawBitmap(253, 140, Speaker, 26, 22, GreyoutColor);
|
||||
if (!screenmute && !afscreen) tft.drawBitmap((advancedRDS ? 215 : 253), (advancedRDS ? 45: 140), Speaker, 21, 20, GreyoutColor);
|
||||
radio.setVolume((VolSet - 40) / 10);
|
||||
XDRMute = false;
|
||||
}
|
||||
@@ -831,7 +831,7 @@ void XDRGTKRoutine() {
|
||||
store = true;
|
||||
XDRMute = false;
|
||||
radio.setUnMute();
|
||||
if (!screenmute) tft.drawBitmap(253, 140, Speaker, 26, 22, GreyoutColor);
|
||||
if (!screenmute && !afscreen) tft.drawBitmap((advancedRDS ? 215 : 253), (advancedRDS ? 45: 140), Speaker, 21, 20, GreyoutColor);
|
||||
VolSet = EEPROM.readByte(EE_BYTE_VOLSET);
|
||||
LowLevelSet = EEPROM.readByte(EE_BYTE_LOWLEVELSET);
|
||||
softmuteam = EEPROM.readByte(EE_BYTE_SOFTMUTEAM);
|
||||
|
||||
@@ -493,28 +493,26 @@ static const uint8_t RDSLogo[] PROGMEM = {
|
||||
};
|
||||
|
||||
static const uint8_t Speaker[] PROGMEM = {
|
||||
0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x18, 0x00, 0x00,
|
||||
0x00, 0x38, 0x00, 0x00,
|
||||
0x00, 0xf8, 0x00, 0x00,
|
||||
0x01, 0xf8, 0x00, 0x00,
|
||||
0xff, 0xf8, 0x00, 0x00,
|
||||
0xff, 0xf8, 0x40, 0x80,
|
||||
0xff, 0xf8, 0xe1, 0xc0,
|
||||
0xff, 0xf8, 0x73, 0x80,
|
||||
0xff, 0xf8, 0x3f, 0x00,
|
||||
0xff, 0xf8, 0x1e, 0x00,
|
||||
0xff, 0xf8, 0x1e, 0x00,
|
||||
0xff, 0xf8, 0x3f, 0x00,
|
||||
0xff, 0xf8, 0x73, 0x80,
|
||||
0xff, 0xf8, 0xe1, 0xc0,
|
||||
0xff, 0xf8, 0x40, 0x80,
|
||||
0xff, 0xf8, 0x00, 0x00,
|
||||
0x01, 0xf8, 0x00, 0x00,
|
||||
0x00, 0xf8, 0x00, 0x00,
|
||||
0x00, 0x38, 0x00, 0x00,
|
||||
0x00, 0x18, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00
|
||||
0x00, 0x00, 0x00,
|
||||
0x00, 0x20, 0x00,
|
||||
0x00, 0x60, 0x00,
|
||||
0x01, 0xe0, 0x00,
|
||||
0x03, 0xe0, 0x00,
|
||||
0x07, 0xe0, 0x00,
|
||||
0xff, 0xe2, 0x10,
|
||||
0xff, 0xe7, 0x38,
|
||||
0xff, 0xe3, 0xf0,
|
||||
0xff, 0xe1, 0xe0,
|
||||
0xff, 0xe1, 0xe0,
|
||||
0xff, 0xe3, 0xf0,
|
||||
0xff, 0xe7, 0x38,
|
||||
0xff, 0xe2, 0x10,
|
||||
0x07, 0xe0, 0x00,
|
||||
0x03, 0xe0, 0x00,
|
||||
0x01, 0xe0, 0x00,
|
||||
0x00, 0x60, 0x00,
|
||||
0x00, 0x20, 0x00,
|
||||
0x00, 0x00, 0x00
|
||||
};
|
||||
|
||||
static const uint8_t WiFi1[] PROGMEM = {
|
||||
|
||||
@@ -2886,7 +2886,7 @@ void BuildAdvancedRDS() {
|
||||
tftPrint(-1, "kHz", 203, 4, ActiveColor, ActiveColorSmooth, 28);
|
||||
|
||||
tft.drawBitmap(70, 5, RDSLogo, 35, 22, GreyoutColor);
|
||||
tft.drawBitmap(253, 140, Speaker, 26, 22, GreyoutColor);
|
||||
tft.drawBitmap(215, 45, Speaker, 21, 20, GreyoutColor);
|
||||
|
||||
if (!StereoToggle) {
|
||||
tft.drawCircle(48, 15, 10, SecondaryColor);
|
||||
@@ -3021,7 +3021,7 @@ void BuildDisplay() {
|
||||
tftPrint(-1, unitString[unit], 282, 145, ActiveColor, ActiveColorSmooth, 16);
|
||||
|
||||
tft.drawBitmap(70, 5, RDSLogo, 35, 22, GreyoutColor);
|
||||
tft.drawBitmap(253, 140, Speaker, 26, 22, GreyoutColor);
|
||||
tft.drawBitmap(253, 140, Speaker, 21, 20, GreyoutColor);
|
||||
|
||||
if (!StereoToggle) {
|
||||
tft.drawCircle(48, 15, 10, SecondaryColor);
|
||||
|
||||
51
src/rds.cpp
51
src/rds.cpp
@@ -356,13 +356,6 @@ void readRds() {
|
||||
tft.fillCircle(200, 41, 5, SignificantColor);
|
||||
}
|
||||
|
||||
if (radio.rds.hasCT) {
|
||||
if (advancedRDS) {
|
||||
tftPrint(1, rds_clock, 208, 109, RDSDropoutColor, RDSDropoutColorSmooth, 16);
|
||||
} else {
|
||||
tftPrint(1, rds_clock, 208, 163, RDSDropoutColor, RDSDropoutColorSmooth, 16);
|
||||
}
|
||||
}
|
||||
dropout = true;
|
||||
}
|
||||
} else {
|
||||
@@ -423,13 +416,6 @@ void readRds() {
|
||||
tft.fillCircle(203, 234, 2, GreyoutColor);
|
||||
}
|
||||
|
||||
if (radio.rds.hasCT) {
|
||||
if (advancedRDS) {
|
||||
tftPrint(1, rds_clock, 208, 109, RDSColor, RDSColorSmooth, 16);
|
||||
} else {
|
||||
tftPrint(1, rds_clock, 208, 163, RDSColor, RDSColorSmooth, 16);
|
||||
}
|
||||
}
|
||||
dropout = false;
|
||||
memreset = false;
|
||||
}
|
||||
@@ -783,8 +769,9 @@ void showPS() {
|
||||
}
|
||||
|
||||
void showCT() {
|
||||
// Temporary string buffer for time formatting
|
||||
char str[6];
|
||||
// Temporary string buffers for time and date formatting
|
||||
char timeStr[6]; // HH:MM
|
||||
char dateStr[9]; // DD-MM-YY
|
||||
time_t t;
|
||||
|
||||
// Determine the current time source
|
||||
@@ -811,7 +798,6 @@ void showCT() {
|
||||
|
||||
// Format the time based on region
|
||||
if (clockampm) { // USA region: 12-hour AM/PM format
|
||||
// Determine AM/PM and adjust hour format
|
||||
int hour = localtime(&t)->tm_hour;
|
||||
String ampm = (hour >= 12) ? "PM" : "AM";
|
||||
if (hour == 0) {
|
||||
@@ -819,19 +805,20 @@ void showCT() {
|
||||
} else if (hour > 12) {
|
||||
hour -= 12; // Convert PM hours
|
||||
}
|
||||
|
||||
// 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());
|
||||
|
||||
rds_clock = String(formattedTime);
|
||||
sprintf(timeStr, "%d:%02d%s", hour, localtime(&t)->tm_min, ampm.c_str());
|
||||
} else { // Other regions: 24-hour format
|
||||
strftime(str, sizeof(str), "%H:%M", localtime(&t));
|
||||
rds_clock = String(str);
|
||||
strftime(timeStr, sizeof(timeStr), "%H:%M", localtime(&t));
|
||||
}
|
||||
|
||||
// Store formatted time in rds_clock
|
||||
rds_clock = String(timeStr);
|
||||
|
||||
// Format the date as DD-MM-YY
|
||||
strftime(dateStr, sizeof(dateStr), "%d-%m-%y", localtime(&t));
|
||||
rds_date = String(dateStr);
|
||||
|
||||
// Check if the clock or RDS CT status has changed
|
||||
if (!screenmute && showclock && (rds_clock != rds_clockold || hasCTold != radio.rds.hasCT)) {
|
||||
if (!screenmute && showclock && (rds_clock != rds_clockold || rds_date != rds_dateold || hasCTold != radio.rds.hasCT)) {
|
||||
|
||||
// Update RTC if RDS CT is available or NTP was updated
|
||||
if ((radio.rds.hasCT && RDSstatus) || NTPupdated) {
|
||||
@@ -840,21 +827,25 @@ void showCT() {
|
||||
rtc.setTime(radio.rds.time);
|
||||
}
|
||||
|
||||
// Display the updated time
|
||||
// Display the updated time and date
|
||||
tftReplace(0, rds_clockold, rds_clock, 135, 1, RDSColor, RDSColorSmooth, BackgroundColor, 16);
|
||||
tftReplace(0, rds_dateold, rds_date, 135, 16, RDSColor, RDSColorSmooth, BackgroundColor, 16);
|
||||
} else { // Handle dropout scenarios
|
||||
|
||||
if (rtcset) { // Display dropout message if RTC was set
|
||||
tftReplace(0, rds_clockold, rds_clock, 135, 1, RDSDropoutColor, RDSDropoutColorSmooth, BackgroundColor, 16);
|
||||
} else { // Clear and reprint the clock
|
||||
tftReplace(0, rds_dateold, rds_date, 135, 16, RDSDropoutColor, RDSDropoutColorSmooth, BackgroundColor, 16);
|
||||
} else { // Clear and reprint the clock and date
|
||||
tftPrint(0, rds_clockold, 135, 1, BackgroundColor, BackgroundColor, 16);
|
||||
tftPrint(0, rds_clock, 135, 1, BackgroundColor, BackgroundColor, 16);
|
||||
tftPrint(0, rds_dateold, 135, 16, BackgroundColor, BackgroundColor, 16);
|
||||
tftPrint(0, rds_date, 135, 16, BackgroundColor, BackgroundColor, 16);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Update previous clock and RDS CT status
|
||||
// Update previous clock, date, and RDS CT status
|
||||
rds_clockold = rds_clock;
|
||||
rds_dateold = rds_date;
|
||||
hasCTold = radio.rds.hasCT;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user