Added Show clock in RDS menu

This commit is contained in:
Sjef Verhoeven PE5PVB
2024-05-29 19:24:44 +02:00
parent 5e2e22be00
commit a29d537874
7 changed files with 84 additions and 28 deletions
+5 -1
View File
@@ -103,7 +103,7 @@ bool screenmute;
bool screensavertriggered = false; bool screensavertriggered = false;
bool seek; bool seek;
bool setupmode; bool setupmode;
byte showrdserrors; bool showclock;
bool usesquelch; bool usesquelch;
bool softmuteam; bool softmuteam;
bool softmutefm; bool softmutefm;
@@ -189,6 +189,7 @@ byte scanmodeold;
byte screensaverOptions[5] = {0, 3, 10, 30, 60}; byte screensaverOptions[5] = {0, 3, 10, 30, 60};
byte screensaverset; byte screensaverset;
byte showmodulation; byte showmodulation;
byte showrdserrors;
byte showSWMIBand; byte showSWMIBand;
byte submenu; byte submenu;
byte stationlistid; byte stationlistid;
@@ -514,6 +515,7 @@ void setup() {
scanmute = EEPROM.readByte(EE_BYTE_SCANMUTE); scanmute = EEPROM.readByte(EE_BYTE_SCANMUTE);
autosquelch = EEPROM.readByte(EE_BYTE_AUTOSQUELCH); autosquelch = EEPROM.readByte(EE_BYTE_AUTOSQUELCH);
longbandpress = EEPROM.readByte(EE_BYTE_LONGBANDPRESS); longbandpress = EEPROM.readByte(EE_BYTE_LONGBANDPRESS);
showclock = EEPROM.readByte(EE_BYTE_SHOWCLOCK);
if (spispeed == SPI_SPEED_DEFAULT) { if (spispeed == SPI_SPEED_DEFAULT) {
tft.setSPISpeed(SPI_FREQUENCY / 1000000); tft.setSPISpeed(SPI_FREQUENCY / 1000000);
@@ -4147,6 +4149,7 @@ void DefaultSettings(byte userhardwaremodel) {
EEPROM.writeByte(EE_BYTE_SCANMUTE, 0); EEPROM.writeByte(EE_BYTE_SCANMUTE, 0);
EEPROM.writeByte(EE_BYTE_AUTOSQUELCH, 0); EEPROM.writeByte(EE_BYTE_AUTOSQUELCH, 0);
EEPROM.writeByte(EE_BYTE_LONGBANDPRESS, 0); EEPROM.writeByte(EE_BYTE_LONGBANDPRESS, 0);
EEPROM.writeByte(EE_BYTE_SHOWCLOCK, 1);
for (int i = 0; i < EE_PRESETS_CNT; i++) { for (int i = 0; i < EE_PRESETS_CNT; i++) {
EEPROM.writeByte(i + EE_PRESETS_BAND_START, BAND_FM); EEPROM.writeByte(i + EE_PRESETS_BAND_START, BAND_FM);
@@ -4374,6 +4377,7 @@ void endMenu() {
EEPROM.writeByte(EE_BYTE_SCANMUTE, scanmute); EEPROM.writeByte(EE_BYTE_SCANMUTE, scanmute);
EEPROM.writeByte(EE_BYTE_AUTOSQUELCH, autosquelch); EEPROM.writeByte(EE_BYTE_AUTOSQUELCH, autosquelch);
EEPROM.writeByte(EE_BYTE_LONGBANDPRESS, longbandpress); EEPROM.writeByte(EE_BYTE_LONGBANDPRESS, longbandpress);
EEPROM.writeByte(EE_BYTE_SHOWCLOCK, showclock);
EEPROM.commit(); EEPROM.commit();
if (af == 2) radio.rds.afreg = true; else radio.rds.afreg = false; if (af == 2) radio.rds.afreg = true; else radio.rds.afreg = false;
Serial.end(); Serial.end();
+5 -4
View File
@@ -209,9 +209,9 @@
#define EE_CHECKBYTE_VALUE 10 // 0 ~ 255,add new entry, change for new value #define EE_CHECKBYTE_VALUE 10 // 0 ~ 255,add new entry, change for new value
#define EE_PRESETS_FREQUENCY 0 // Default value when memory channel should be skipped! #define EE_PRESETS_FREQUENCY 0 // Default value when memory channel should be skipped!
#ifdef HAS_AIR_BAND #ifdef HAS_AIR_BAND
#define EE_TOTAL_CNT 2221 // Total occupied eeprom bytes #define EE_TOTAL_CNT 2222 // Total occupied eeprom bytes
#else #else
#define EE_TOTAL_CNT 2216 // Total occupied eeprom bytes #define EE_TOTAL_CNT 2217 // Total occupied eeprom bytes
#endif #endif
#define EE_PRESETS_BAND_START 0 // 99 * 1 byte #define EE_PRESETS_BAND_START 0 // 99 * 1 byte
@@ -312,9 +312,10 @@
#define EE_BYTE_SCANMUTE 2213 #define EE_BYTE_SCANMUTE 2213
#define EE_BYTE_AUTOSQUELCH 2214 #define EE_BYTE_AUTOSQUELCH 2214
#define EE_BYTE_LONGBANDPRESS 2215 #define EE_BYTE_LONGBANDPRESS 2215
#define EE_BYTE_SHOWCLOCK 2216
#ifdef HAS_AIR_BAND #ifdef HAS_AIR_BAND
#define EE_BYTE_AIRSTEPSIZE 2116 #define EE_BYTE_AIRSTEPSIZE 2117
#define EE_UINT16_FREQUENCY_AIR 2217 #define EE_UINT16_FREQUENCY_AIR 2218
#endif #endif
// End of EEPROM index defines // End of EEPROM index defines
+32 -1
View File
@@ -8,7 +8,7 @@
#include <cstring> #include <cstring>
byte menuitem; byte menuitem;
byte items[9] = {9, static_cast<byte>(dynamicspi ? 10 : 9), 7, 10, 9, 10, 9, 6, 7}; byte items[9] = {9, static_cast<byte>(dynamicspi ? 10 : 9), 7, 10, 10, 10, 9, 6, 7};
extern mem presets[]; extern mem presets[];
void doTheme() { // Use this to put your own colors in: http://www.barth-dev.de/online/rgb565-color-picker/ void doTheme() { // Use this to put your own colors in: http://www.barth-dev.de/online/rgb565-color-picker/
@@ -1394,6 +1394,16 @@ void ShowOneLine(byte position, byte item, bool selected) {
FullLineSprite.drawString(FreqFont[freqfont], 298, 3); FullLineSprite.drawString(FreqFont[freqfont], 298, 3);
break; break;
case RDSSETTINGS:
FullLineSprite.setTextDatum(TL_DATUM);
FullLineSprite.setTextColor(ActiveColor, ActiveColorSmooth, false);
FullLineSprite.drawString(removeNewline(myLanguage[language][262]), 6, 3);
FullLineSprite.setTextDatum(TR_DATUM);
FullLineSprite.setTextColor(PrimaryColor, PrimaryColorSmooth, false);
FullLineSprite.drawString((showclock ? myLanguage[language][42] : myLanguage[language][30]), 298, 3);
break;
case FMSETTINGS: case FMSETTINGS:
FullLineSprite.setTextDatum(TL_DATUM); FullLineSprite.setTextDatum(TL_DATUM);
FullLineSprite.setTextColor(ActiveColor, ActiveColorSmooth, false); FullLineSprite.setTextColor(ActiveColor, ActiveColorSmooth, false);
@@ -2228,6 +2238,13 @@ void MenuUp() {
OneBigLineSprite.pushSprite(24, 118); OneBigLineSprite.pushSprite(24, 118);
break; break;
case ITEM10:
showclock = !showclock;
OneBigLineSprite.drawString((showclock ? myLanguage[language][42] : myLanguage[language][30]), 135, 0);
OneBigLineSprite.pushSprite(24, 118);
break;
} }
break; break;
@@ -3083,6 +3100,13 @@ void MenuDown() {
OneBigLineSprite.pushSprite(24, 118); OneBigLineSprite.pushSprite(24, 118);
break; break;
case ITEM10:
showclock = !showclock;
OneBigLineSprite.drawString((showclock ? myLanguage[language][42] : myLanguage[language][30]), 135, 0);
OneBigLineSprite.pushSprite(24, 118);
break;
} }
break; break;
@@ -3946,6 +3970,13 @@ void DoMenu() {
OneBigLineSprite.pushSprite(24, 118); OneBigLineSprite.pushSprite(24, 118);
break; break;
case ITEM10:
Infoboxprint(myLanguage[language][262]);
OneBigLineSprite.drawString((showclock ? myLanguage[language][42] : myLanguage[language][30]), 135, 0);
OneBigLineSprite.pushSprite(24, 118);
break;
} }
break; break;
+1
View File
@@ -59,6 +59,7 @@ extern bool usesquelch;
extern bool scandxmode; extern bool scandxmode;
extern bool scanmem; extern bool scanmem;
extern bool scanmute; extern bool scanmute;
extern bool showclock;
extern bool softmuteam; extern bool softmuteam;
extern bool softmutefm; extern bool softmutefm;
extern bool Stereostatusold; extern bool Stereostatusold;
+37 -19
View File
@@ -5,7 +5,7 @@
// [number of languages][number of texts] // [number of languages][number of texts]
static const char* const myLanguage[18][262] PROGMEM = { static const char* const myLanguage[18][263] PROGMEM = {
{ "English", // English { "English", // English
"Rotary direction changed", // 1 "Rotary direction changed", // 1
"Please release button", // 2 "Please release button", // 2
@@ -267,7 +267,8 @@ static const char* const myLanguage[18][262] PROGMEM = {
"Alarm Test", // 258 "Alarm Test", // 258
"Alarm!!!", // 259 "Alarm!!!", // 259
"Initial", // 260 "Initial", // 260
"Always" //261 "Always", // 261
"Show clock" // 262
}, },
{ "Nederlands", // Dutch { "Nederlands", // Dutch
@@ -531,7 +532,8 @@ static const char* const myLanguage[18][262] PROGMEM = {
"Alarmtest", // 258 "Alarmtest", // 258
"Alarm ! ALARM !", // 259 "Alarm ! ALARM !", // 259
"Initieel", // 260 "Initieel", // 260
"Altijd" //261 "Altijd", //261
"Toon klok" // 262
}, },
{ "Polski", // Polish { "Polski", // Polish
@@ -795,7 +797,8 @@ static const char* const myLanguage[18][262] PROGMEM = {
"Alarm Test", // 258 "Alarm Test", // 258
"Alarm", // 259 "Alarm", // 259
"Początkowy", // 260 "Początkowy", // 260
"Zawsze" // 261 "Zawsze", // 261
"Pokaż zegar" // 262
}, },
{ "Hrvatski", // Croatian { "Hrvatski", // Croatian
@@ -1059,7 +1062,8 @@ static const char* const myLanguage[18][262] PROGMEM = {
"Testni alarm!", // 258 "Testni alarm!", // 258
"Alarm !", // 259 "Alarm !", // 259
"Početno", // 260 "Početno", // 260
"Uvijek" //261 "Uvijek", //261
"Prikaži sat" // 262
}, },
{ "Ελληνικά", // Greek { "Ελληνικά", // Greek
@@ -1323,7 +1327,8 @@ static const char* const myLanguage[18][262] PROGMEM = {
"Δοκιμή συναγερμού", // 258 "Δοκιμή συναγερμού", // 258
"Συναγερμός!!!", // 259 "Συναγερμός!!!", // 259
"Αρχικό", // 260 "Αρχικό", // 260
"Πάντα" //261 "Πάντα", //261
"Εμφάνιση ρολογιού" // 262
}, },
{ "Română", // Romanian { "Română", // Romanian
@@ -1587,7 +1592,8 @@ static const char* const myLanguage[18][262] PROGMEM = {
"Test Alarmă", // 258 "Test Alarmă", // 258
"Alarmă !", // 259 "Alarmă !", // 259
"Inițial", // 260 "Inițial", // 260
"Mereu" //261 "Mereu", //261
"Arată ceasul" // 262
}, },
{ "Deutsch", // German { "Deutsch", // German
@@ -1851,7 +1857,8 @@ static const char* const myLanguage[18][262] PROGMEM = {
"Alarm Test", // 258 "Alarm Test", // 258
"Alarm! Alarm!", // 259 "Alarm! Alarm!", // 259
"Anfänglich", // 260 "Anfänglich", // 260
"Immer" // 261 "Immer", // 261
"Uhr anzeigen" // 262
}, },
{ "Český", // Czech { "Český", // Czech
@@ -2115,7 +2122,8 @@ static const char* const myLanguage[18][262] PROGMEM = {
"Alarm Test", // 258 "Alarm Test", // 258
"Alarm Alarm !", // 259 "Alarm Alarm !", // 259
"Počáteční", // 260 "Počáteční", // 260
"Vždy" //261 "Vždy", //261
"Zobrazit hodiny" // 262
}, },
{ "Magyar", // Hungarian { "Magyar", // Hungarian
@@ -2379,7 +2387,8 @@ static const char* const myLanguage[18][262] PROGMEM = {
"Riasztás Teszt", // 258 "Riasztás Teszt", // 258
"Riasztás!!!", // 259 "Riasztás!!!", // 259
"Kezdeti", // 260 "Kezdeti", // 260
"Mindig" //261 "Mindig", //261
"Órát mutass" // 262
}, },
{ "Français", // French { "Français", // French
@@ -2643,7 +2652,8 @@ static const char* const myLanguage[18][262] PROGMEM = {
"TEST", // 258 "TEST", // 258
"Alerte !", // 259 "Alerte !", // 259
"Initial", // 260 "Initial", // 260
"Toujours" // 261 "Toujours", // 261
"Afficher l'horloge" // 262
}, },
{ "Български", // Bulgarian { "Български", // Bulgarian
@@ -2907,7 +2917,8 @@ static const char* const myLanguage[18][262] PROGMEM = {
"Внимание тест", // 258 "Внимание тест", // 258
"Тревога!", // 259 "Тревога!", // 259
"Начален", // 260 "Начален", // 260
"Винаги" // 261 "Винаги", // 261
"Покажи часовника" // 262
}, },
{ "Русский", // Russian { "Русский", // Russian
@@ -3171,7 +3182,8 @@ static const char* const myLanguage[18][262] PROGMEM = {
"Внимание тест", // 258 "Внимание тест", // 258
"Тревога!", // 259 "Тревога!", // 259
"Начальный", // 260 "Начальный", // 260
"Всегда" // 261 "Всегда", // 261
"Показать часы" // 262
}, },
{ "Українська", // Ukranian { "Українська", // Ukranian
@@ -3435,7 +3447,8 @@ static const char* const myLanguage[18][262] PROGMEM = {
"Alarm Test", // 258 "Alarm Test", // 258
"Alarm!!!", // 259 "Alarm!!!", // 259
"Початковий", // 260 "Початковий", // 260
"Завжди" // 261 "Завжди", // 261
"Показати годинник" // 262
}, },
{ "Italiano", // Italian { "Italiano", // Italian
@@ -3699,7 +3712,8 @@ static const char* const myLanguage[18][262] PROGMEM = {
"Test Allarme", // 258 "Test Allarme", // 258
"!!Allarme!!", // 259 "!!Allarme!!", // 259
"Iniziale", // 260 "Iniziale", // 260
"Sempre" // 261 "Sempre", // 261
"Mostra l'orologio" // 262
}, },
{ "Simplified Chinese", // Simplified Chinese { "Simplified Chinese", // Simplified Chinese
@@ -3963,7 +3977,8 @@ static const char* const myLanguage[18][262] PROGMEM = {
"Alarm Test", // 258 "Alarm Test", // 258
"Alarm!!!", // 259 "Alarm!!!", // 259
"初始", // 260 "初始", // 260
"始终" // 261 "始终", // 261
"显示时钟" // 262
}, },
{ "Norsk", // Norwegian { "Norsk", // Norwegian
@@ -4227,7 +4242,8 @@ static const char* const myLanguage[18][262] PROGMEM = {
"Alarm test", // 258 "Alarm test", // 258
"Alarm!", // 259 "Alarm!", // 259
"Innledende", // 260 "Innledende", // 260
"Alltid" // 261 "Alltid", // 261
"Vis klokka" // 262
}, },
{ "Español", // Spanish { "Español", // Spanish
@@ -4491,7 +4507,8 @@ static const char* const myLanguage[18][262] PROGMEM = {
"Prueba de Alarma", // 258 "Prueba de Alarma", // 258
"¡ Alarma !", // 259 "¡ Alarma !", // 259
"Inicial", // 260 "Inicial", // 260
"Siempre" // 261 "Siempre", // 261
"Mostrar reloj" // 262
}, },
{ "Português", // Portuguese { "Português", // Portuguese
@@ -4755,7 +4772,8 @@ static const char* const myLanguage[18][262] PROGMEM = {
"Teste de Alarme", // 258 "Teste de Alarme", // 258
"Alarme Alarme !", // 259 "Alarme Alarme !", // 259
"Inicial", // 260 "Inicial", // 260
"Sempre" // 261 "Sempre", // 261
"Mostrar relógio" // 262
} }
}; };
#endif #endif
+1 -1
View File
@@ -748,7 +748,7 @@ void showPS() {
} }
void showCT() { void showCT() {
if (!screenmute) { if (!screenmute && showclock) {
if (radio.rds.hasCT && !dropout) { if (radio.rds.hasCT && !dropout) {
rds_clock = ((radio.rds.hour < 10 ? "0" : "") + String(radio.rds.hour) + ":" + (radio.rds.minute < 10 ? "0" : "") + String(radio.rds.minute)); rds_clock = ((radio.rds.hour < 10 ? "0" : "") + String(radio.rds.hour) + ":" + (radio.rds.minute < 10 ? "0" : "") + String(radio.rds.minute));
} else if (!radio.rds.hasCT || dropout) { } else if (!radio.rds.hasCT || dropout) {
+2 -1
View File
@@ -34,7 +34,7 @@ extern bool rdsstereoold;
extern bool rtcset; extern bool rtcset;
extern bool screenmute; extern bool screenmute;
extern bool setupmode; extern bool setupmode;
extern byte showrdserrors; extern bool showclock;
extern bool TAold; extern bool TAold;
extern bool TPold; extern bool TPold;
extern bool wifi; extern bool wifi;
@@ -54,6 +54,7 @@ extern byte eonptyold[20];
extern byte rdsblockold; extern byte rdsblockold;
extern byte rdsqualityold; extern byte rdsqualityold;
extern byte region; extern byte region;
extern byte showrdserrors;
extern byte stationlistid; extern byte stationlistid;
extern char eonpicodeold[20][6]; extern char eonpicodeold[20][6];
extern char programTypePrevious[18]; extern char programTypePrevious[18];