Added option to disable display when XDRGTK is connected

This commit is contained in:
Sjef Verhoeven PE5PVB
2024-02-04 16:18:32 +01:00
parent 4915ce8b4f
commit 2612a2782e
7 changed files with 80 additions and 33 deletions
+5 -1
View File
@@ -105,6 +105,7 @@ bool TAold;
bool TPold; bool TPold;
bool tuned; bool tuned;
bool USBmode = 1; bool USBmode = 1;
bool XDRGTKMuteScreen;
bool wifi; bool wifi;
bool wificonnected; bool wificonnected;
bool XDRGTKdata; bool XDRGTKdata;
@@ -462,6 +463,7 @@ void setup() {
fmscansens = EEPROM.readByte(EE_BYTE_FMSCANSENS); fmscansens = EEPROM.readByte(EE_BYTE_FMSCANSENS);
freqfont = EEPROM.readByte(EE_BYTE_FREQFONT); freqfont = EEPROM.readByte(EE_BYTE_FREQFONT);
CurrentSkin = EEPROM.readByte(EE_BYTE_SKIN); CurrentSkin = EEPROM.readByte(EE_BYTE_SKIN);
XDRGTKMuteScreen = EEPROM.readByte(EE_BYTE_XDRGTKMUTE);
if (spispeed == SPI_SPEED_DEFAULT) tft.setSPISpeed(SPI_FREQUENCY / 1000000); else tft.setSPISpeed(spispeed * 10); if (spispeed == SPI_SPEED_DEFAULT) tft.setSPISpeed(SPI_FREQUENCY / 1000000); else tft.setSPISpeed(spispeed * 10);
LWLowEdgeSet = FREQ_LW_LOW_EDGE_MIN; LWLowEdgeSet = FREQ_LW_LOW_EDGE_MIN;
@@ -743,7 +745,7 @@ void setup() {
void loop() { void loop() {
Communication(); Communication();
if (tot != 0) { if (tot != 0) {
unsigned long totprobe = tot * 60000; unsigned long totprobe = tot * 60000;
if (millis() >= tottimer + totprobe) deepSleep(); if (millis() >= tottimer + totprobe) deepSleep();
@@ -1949,6 +1951,7 @@ void ModeButtonPress() {
EEPROM.writeByte(EE_BYTE_FMSCANSENS, fmscansens); EEPROM.writeByte(EE_BYTE_FMSCANSENS, fmscansens);
EEPROM.writeByte(EE_BYTE_FREQFONT, freqfont); EEPROM.writeByte(EE_BYTE_FREQFONT, freqfont);
EEPROM.writeByte(EE_BYTE_SKIN, CurrentSkin); EEPROM.writeByte(EE_BYTE_SKIN, CurrentSkin);
EEPROM.writeByte(EE_BYTE_XDRGTKMUTE, XDRGTKMuteScreen);
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;
if (!usesquelch) radio.setUnMute(); if (!usesquelch) radio.setUnMute();
@@ -3601,6 +3604,7 @@ void DefaultSettings(byte userhardwaremodel) {
EEPROM.writeByte(EE_BYTE_FMSCANSENS, 4); EEPROM.writeByte(EE_BYTE_FMSCANSENS, 4);
EEPROM.writeByte(EE_BYTE_FREQFONT, 3); EEPROM.writeByte(EE_BYTE_FREQFONT, 3);
EEPROM.writeByte(EE_BYTE_SKIN, 0); EEPROM.writeByte(EE_BYTE_SKIN, 0);
EEPROM.writeByte(EE_BYTE_XDRGTKMUTE, 0);
EEPROM.commit(); EEPROM.commit();
} }
+8 -4
View File
@@ -119,6 +119,7 @@ void Communication() {
SelectBand(); SelectBand();
} }
XDRGTKTCP = true; XDRGTKTCP = true;
if (XDRGTKMuteScreen) MuteScreen(1);
RemoteClient.print("o1,0\n"); RemoteClient.print("o1,0\n");
RemoteClient.print("G" + String(!EQset) + String(!iMSset) + "\n"); RemoteClient.print("G" + String(!EQset) + String(!iMSset) + "\n");
store = true; store = true;
@@ -159,6 +160,7 @@ void Communication() {
} }
Serial.print("OK\nT" + String(frequency * 10) + "\nG" + String(!EQset) + String(!iMSset) + "\n"); Serial.print("OK\nT" + String(frequency * 10) + "\nG" + String(!EQset) + String(!iMSset) + "\n");
XDRGTKUSB = true; XDRGTKUSB = true;
if (XDRGTKMuteScreen) MuteScreen(1);
} }
} }
@@ -500,6 +502,7 @@ void XDRGTKRoutine() {
case 'x': case 'x':
DataPrint("OK\nT" + String(frequency * 10) + "\n"); DataPrint("OK\nT" + String(frequency * 10) + "\n");
if (XDRGTKMuteScreen) MuteScreen(1);
break; break;
case 'X': case 'X':
@@ -517,6 +520,7 @@ void XDRGTKRoutine() {
radio.setSoftmuteFM(softmutefm); radio.setSoftmuteFM(softmutefm);
radio.setSoftmuteAM(softmuteam); radio.setSoftmuteAM(softmuteam);
if (!usesquelch) radio.setUnMute(); if (!usesquelch) radio.setUnMute();
if (XDRGTKMuteScreen) MuteScreen(0);
break; break;
case 'Z': case 'Z':
@@ -524,19 +528,19 @@ void XDRGTKRoutine() {
ANT = atol(buff + 1); ANT = atol(buff + 1);
switch (ANT) { switch (ANT) {
case 0: case 0:
// Antenna A // Antenna A
break; break;
case 1: case 1:
// Antenna B // Antenna B
break; break;
case 2: case 2:
// Antenna C // Antenna C
break; break;
case 3: case 3:
// Antenna D // Antenna D
break; break;
} }
DataPrint("Z" + String(ANT) + "\n"); DataPrint("Z" + String(ANT) + "\n");
+1 -1
View File
@@ -35,7 +35,7 @@ extern bool wificonnected;
extern bool XDRGTKdata; extern bool XDRGTKdata;
extern bool XDRGTKTCP; extern bool XDRGTKTCP;
extern bool XDRGTKUSB; extern bool XDRGTKUSB;
extern bool XDRMute; extern bool XDRGTKMuteScreen;
extern bool XDRMute; extern bool XDRMute;
extern byte band; extern byte band;
extern byte BWset; extern byte BWset;
+7 -6
View File
@@ -196,9 +196,9 @@
// EEPROM index defines // EEPROM index defines
#define EE_PRESETS_CNT 99 #define EE_PRESETS_CNT 99
#define EE_CHECKBYTE_VALUE 2 // 0 ~ 255,add new entry, change for new value #define EE_CHECKBYTE_VALUE 3 // 0 ~ 255,add new entry, change for new value
#define EE_TOTAL_CNT 823 #define EE_TOTAL_CNT 824
#define EE_UINT16_FREQUENCY_FM 0 #define EE_UINT16_FREQUENCY_FM 0
#define EE_BYTE_VOLSET 4 #define EE_BYTE_VOLSET 4
#define EE_BYTE_STEREO 5 #define EE_BYTE_STEREO 5
@@ -278,10 +278,11 @@
#define EE_BYTE_FMSCANSENS 123 #define EE_BYTE_FMSCANSENS 123
#define EE_BYTE_FREQFONT 124 #define EE_BYTE_FREQFONT 124
#define EE_BYTE_SKIN 125 #define EE_BYTE_SKIN 125
#define EE_PRESETS_BAND_START 126 #define EE_BYTE_XDRGTKMUTE 126
#define EE_PRESET_BW_START 226 #define EE_PRESETS_BAND_START 127
#define EE_PRESET_MS_START 326 #define EE_PRESET_BW_START 227
#define EE_PRESETS_START 426 #define EE_PRESET_MS_START 327
#define EE_PRESETS_START 427
#define EE_PRESETS_FREQUENCY 0 #define EE_PRESETS_FREQUENCY 0
// End of EEPROM index defines // End of EEPROM index defines
+20 -1
View File
@@ -8,7 +8,7 @@
byte menuitem; byte menuitem;
byte items[8] = {8, static_cast<byte>(dynamicspi ? 5 : 4), 7, 10, 9, 10, 10, 5}; byte items[8] = {8, static_cast<byte>(dynamicspi ? 5 : 4), 7, 10, 9, 10, 10, 6};
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/
switch (CurrentTheme) { switch (CurrentTheme) {
@@ -714,12 +714,14 @@ void BuildMenu() {
tftPrint(-1, myLanguage[language][52], 8, ITEM3 + 6, ActiveColor, ActiveColorSmooth, 16); tftPrint(-1, myLanguage[language][52], 8, ITEM3 + 6, ActiveColor, ActiveColorSmooth, 16);
tftPrint(-1, myLanguage[language][58], 8, ITEM4 + 6, ActiveColor, ActiveColorSmooth, 16); tftPrint(-1, myLanguage[language][58], 8, ITEM4 + 6, ActiveColor, ActiveColorSmooth, 16);
tftPrint(-1, myLanguage[language][197], 8, ITEM5 + 6, ActiveColor, ActiveColorSmooth, 16); tftPrint(-1, myLanguage[language][197], 8, ITEM5 + 6, ActiveColor, ActiveColorSmooth, 16);
tftPrint(-1, myLanguage[language][205], 8, ITEM6 + 6, ActiveColor, ActiveColorSmooth, 16);
if (USBmode) tftPrint(1, "RDS Spy", 310, ITEM1 + 6, PrimaryColor, PrimaryColorSmooth, 16); else tftPrint(1, "XDRGTK", 310, ITEM1 + 6, PrimaryColor, PrimaryColorSmooth, 16); if (USBmode) tftPrint(1, "RDS Spy", 310, ITEM1 + 6, PrimaryColor, PrimaryColorSmooth, 16); else tftPrint(1, "XDRGTK", 310, ITEM1 + 6, PrimaryColor, PrimaryColorSmooth, 16);
if (wifi) tftPrint(1, myLanguage[language][42], 310, ITEM2 + 6, PrimaryColor, PrimaryColorSmooth, 16); else tftPrint(1, myLanguage[language][30], 310, ITEM2 + 6, PrimaryColor, PrimaryColorSmooth, 16); if (wifi) tftPrint(1, myLanguage[language][42], 310, ITEM2 + 6, PrimaryColor, PrimaryColorSmooth, 16); else tftPrint(1, myLanguage[language][30], 310, ITEM2 + 6, PrimaryColor, PrimaryColorSmooth, 16);
tftPrint(1, ">", 310, ITEM3 + 6, PrimaryColor, PrimaryColorSmooth, 16); tftPrint(1, ">", 310, ITEM3 + 6, PrimaryColor, PrimaryColorSmooth, 16);
if (wifi) tftPrint(1, String(WiFi.localIP()[0]) + "." + String(WiFi.localIP()[1]) + "." + String(WiFi.localIP()[2]) + "." + String(subnetclient, DEC), 310, ITEM4 + 6, PrimaryColor, PrimaryColorSmooth, 16); else tftPrint(1, "-", 310, ITEM4 + 6, PrimaryColor, PrimaryColorSmooth, 16); if (wifi) tftPrint(1, String(WiFi.localIP()[0]) + "." + String(WiFi.localIP()[1]) + "." + String(WiFi.localIP()[2]) + "." + String(subnetclient, DEC), 310, ITEM4 + 6, PrimaryColor, PrimaryColorSmooth, 16); else tftPrint(1, "-", 310, ITEM4 + 6, PrimaryColor, PrimaryColorSmooth, 16);
tftPrint(1, String(stationlistid, DEC), 310, ITEM5 + 6, PrimaryColor, PrimaryColorSmooth, 16); tftPrint(1, String(stationlistid, DEC), 310, ITEM5 + 6, PrimaryColor, PrimaryColorSmooth, 16);
if (XDRGTKMuteScreen) tftPrint(1, myLanguage[language][42], 310, ITEM6 + 6, PrimaryColor, PrimaryColorSmooth, 16); else tftPrint(1, myLanguage[language][30], 310, ITEM6 + 6, PrimaryColor, PrimaryColorSmooth, 16);
break; break;
} }
@@ -1577,6 +1579,12 @@ void MenuUp() {
if (stationlistid > 10) stationlistid = 1; if (stationlistid > 10) stationlistid = 1;
tftPrint(0, String(stationlistid, DEC), 155, 118, PrimaryColor, PrimaryColorSmooth, 28); tftPrint(0, String(stationlistid, DEC), 155, 118, PrimaryColor, PrimaryColorSmooth, 28);
break; break;
case ITEM6:
if (XDRGTKMuteScreen) tftPrint(0, myLanguage[language][42], 155, 118, BackgroundColor, BackgroundColor, 28); else tftPrint(0, myLanguage[language][30], 155, 118, BackgroundColor, BackgroundColor, 28);
if (XDRGTKMuteScreen) XDRGTKMuteScreen = false; else XDRGTKMuteScreen = true;
if (XDRGTKMuteScreen) tftPrint(0, myLanguage[language][42], 155, 118, PrimaryColor, PrimaryColorSmooth, 28); else tftPrint(0, myLanguage[language][30], 155, 118, PrimaryColor, PrimaryColorSmooth, 28);
break;
} }
break; break;
} }
@@ -2168,6 +2176,12 @@ void MenuDown() {
if (stationlistid == 0) stationlistid = 10; if (stationlistid == 0) stationlistid = 10;
tftPrint(0, String(stationlistid, DEC), 155, 118, PrimaryColor, PrimaryColorSmooth, 28); tftPrint(0, String(stationlistid, DEC), 155, 118, PrimaryColor, PrimaryColorSmooth, 28);
break; break;
case ITEM6:
if (XDRGTKMuteScreen) tftPrint(0, myLanguage[language][42], 155, 118, BackgroundColor, BackgroundColor, 28); else tftPrint(0, myLanguage[language][30], 155, 118, BackgroundColor, BackgroundColor, 28);
if (XDRGTKMuteScreen) XDRGTKMuteScreen = false; else XDRGTKMuteScreen = true;
if (XDRGTKMuteScreen) tftPrint(0, myLanguage[language][42], 155, 118, PrimaryColor, PrimaryColorSmooth, 28); else tftPrint(0, myLanguage[language][30], 155, 118, PrimaryColor, PrimaryColorSmooth, 28);
break;
} }
break; break;
} }
@@ -2664,6 +2678,11 @@ void DoMenu() {
Infoboxprint(myLanguage[language][197]); Infoboxprint(myLanguage[language][197]);
tftPrint(0, String(stationlistid, DEC), 155, 118, PrimaryColor, PrimaryColorSmooth, 28); tftPrint(0, String(stationlistid, DEC), 155, 118, PrimaryColor, PrimaryColorSmooth, 28);
break; break;
case ITEM6:
Infoboxprint(myLanguage[language][205]);
if (XDRGTKMuteScreen) tftPrint(0, myLanguage[language][42], 155, 118, PrimaryColor, PrimaryColorSmooth, 28); else tftPrint(0, myLanguage[language][30], 155, 118, PrimaryColor, PrimaryColorSmooth, 28);
break;
} }
break; break;
} }
+1
View File
@@ -58,6 +58,7 @@ extern bool StereoToggle;
extern bool TAold; extern bool TAold;
extern bool TPold; extern bool TPold;
extern bool USBmode; extern bool USBmode;
extern bool XDRGTKMuteScreen;
extern bool wifi; extern bool wifi;
extern byte af; extern byte af;
extern byte af_counterold; extern byte af_counterold;
+38 -20
View File
@@ -1,11 +1,11 @@
#ifndef LANGUAGE_H #ifndef LANGUAGE_H
#define LANGUAGE_H #define LANGUAGE_H
#define VERSION "v2.00.3" #define VERSION "v2.00.4"
// [number of languages][number of texts] // [number of languages][number of texts]
// *** means the text is the same as in English // *** means the text is the same as in English
static const char* const myLanguage[18][205] = { static const char* const myLanguage[18][206] = {
{ "English", // English { "English", // English
"Rotary direction changed", // 1 "Rotary direction changed", // 1
"Please release button", // 2 "Please release button", // 2
@@ -210,7 +210,8 @@ static const char* const myLanguage[18][205] = {
"Large", // 201 "Large", // 201
"All", // 202 "All", // 202
"Fast PS", // 203 "Fast PS", // 203
"Default" // 204 "Default", // 204
"Mute screen on\nXDRGTK connection" // 205
}, },
{ "Nederlands", // Dutch { "Nederlands", // Dutch
@@ -417,7 +418,8 @@ static const char* const myLanguage[18][205] = {
"Middel", // 201 "Middel", // 201
"Alles", // 202 "Alles", // 202
"Snelle PS", // 203 "Snelle PS", // 203
"Standaard" // 204 "Standaard", // 204
"Scherm uit bij\nXDRGTK verbinding" // 205
}, },
{ "Polski", // Polish { "Polski", // Polish
@@ -624,7 +626,8 @@ static const char* const myLanguage[18][205] = {
"Duże", // 201 "Duże", // 201
"Wszystkie", // 202 "Wszystkie", // 202
"Szybki PS", // 203 "Szybki PS", // 203
"Default" // 204 "Default", // 204
"Mute screen on\nXDRGTK connection" // 205
}, },
{ "Hrvatski", // Croatian { "Hrvatski", // Croatian
@@ -831,7 +834,8 @@ static const char* const myLanguage[18][205] = {
"Veliko", // 201 "Veliko", // 201
"Sve", // 202 "Sve", // 202
"Brzi PS", // 203 "Brzi PS", // 203
"Zadano" // 204 "Zadano", // 204
"Mute screen on\nXDRGTK connection" // 205
}, },
{ "Ελληνικά", // Greek { "Ελληνικά", // Greek
@@ -1038,7 +1042,8 @@ static const char* const myLanguage[18][205] = {
"Μεγάλο", // 201 "Μεγάλο", // 201
"Όλα", // 202 "Όλα", // 202
"Γρήγορο PS", // 203 "Γρήγορο PS", // 203
"Default" // 204 "Default", // 204
"Mute screen on\nXDRGTK connection" // 205
}, },
{ "Română", // Romanian { "Română", // Romanian
@@ -1245,7 +1250,8 @@ static const char* const myLanguage[18][205] = {
"Mare", // 201 "Mare", // 201
"Tot", // 202 "Tot", // 202
"PS rapid", // 203 "PS rapid", // 203
"Mod implicit" // 204 "Mod implicit", // 204
"Mute screen on\nXDRGTK connection" // 205
}, },
{ "Deutsch", // German { "Deutsch", // German
@@ -1452,7 +1458,8 @@ static const char* const myLanguage[18][205] = {
"Viel", // 201 "Viel", // 201
"Maximal", // 202 "Maximal", // 202
"Schnelles PS", // 203 "Schnelles PS", // 203
"Default" // 204 "Default", // 204
"Mute screen on\nXDRGTK connection" // 205
}, },
{ "Český", // Czech { "Český", // Czech
@@ -1659,7 +1666,8 @@ static const char* const myLanguage[18][205] = {
"Velký", // 201 "Velký", // 201
"Vše", // 202 "Vše", // 202
"Rychlé načtení PS", // 203 "Rychlé načtení PS", // 203
"Default" // 204 "Default", // 204
"Mute screen on\nXDRGTK connection" // 205
}, },
{ "Slovenský", // Slovak { "Slovenský", // Slovak
@@ -1866,7 +1874,8 @@ static const char* const myLanguage[18][205] = {
"Veľký", // 201 "Veľký", // 201
"Všetko", // 202 "Všetko", // 202
"Rýchle načítanie PS", // 203 "Rýchle načítanie PS", // 203
"Default" // 204 "Default", // 204
"Mute screen on\nXDRGTK connection" // 205
}, },
{ "Français", // French { "Français", // French
@@ -2073,7 +2082,8 @@ static const char* const myLanguage[18][205] = {
"Grosses", // 201 "Grosses", // 201
"Toutes", // 202 "Toutes", // 202
"PS rapide", // 203 "PS rapide", // 203
"Default" // 204 "Default", // 204
"Mute screen on\nXDRGTK connection" // 205
}, },
{ "Български", // Bulgarian { "Български", // Bulgarian
@@ -2280,7 +2290,8 @@ static const char* const myLanguage[18][205] = {
"Large", // 201 *** "Large", // 201 ***
"Всички", // 202 "Всички", // 202
"Fast PS", // 203 *** "Fast PS", // 203 ***
"Default" // 204 "Default", // 204
"Mute screen on\nXDRGTK connection" // 205
}, },
{ "Русский", // Russian { "Русский", // Russian
@@ -2487,7 +2498,8 @@ static const char* const myLanguage[18][205] = {
"Больше", // 201 "Больше", // 201
"Все", // 202 "Все", // 202
"Быстрый PS", // 203 "Быстрый PS", // 203
"Default" // 204 "Default", // 204
"Mute screen on\nXDRGTK connection" // 205
}, },
{ "Українська", // Ukranian { "Українська", // Ukranian
@@ -2694,7 +2706,8 @@ static const char* const myLanguage[18][205] = {
"Багато", // 201 "Багато", // 201
"Усе", // 202 "Усе", // 202
"Швидкий PS", // 203 "Швидкий PS", // 203
"Default" // 204 "Default", // 204
"Mute screen on\nXDRGTK connection" // 205
}, },
{ "Italiano", // Italian { "Italiano", // Italian
@@ -2901,7 +2914,8 @@ static const char* const myLanguage[18][205] = {
"Grande", // 201 *** "Grande", // 201 ***
"Tutto", // 202 *** "Tutto", // 202 ***
"PS veloce", // 203 *** "PS veloce", // 203 ***
"Default" // 204 "Default", // 204
"Mute screen on\nXDRGTK connection" // 205
}, },
{ "Simplified Chinese", // Simplified Chinese { "Simplified Chinese", // Simplified Chinese
@@ -3108,7 +3122,8 @@ static const char* const myLanguage[18][205] = {
"大量", // 201 "大量", // 201
"全部", // 202 "全部", // 202
"快速 PS", // 203 "快速 PS", // 203
"Default" // 204 "Default", // 204
"Mute screen on\nXDRGTK connection" // 205
}, },
{ "Norsk", // Norwegian { "Norsk", // Norwegian
@@ -3315,7 +3330,8 @@ static const char* const myLanguage[18][205] = {
"Mye", // 201 "Mye", // 201
"Alt", // 202 "Alt", // 202
"Rask PS", // 203 "Rask PS", // 203
"Standard" // 204 "Standard", // 204
"Mute screen on\nXDRGTK connection" // 205
}, },
{ "Español", // Spanish { "Español", // Spanish
@@ -3522,7 +3538,8 @@ static const char* const myLanguage[18][205] = {
"Grande", // 201 "Grande", // 201
"Todo", // 202 "Todo", // 202
"PS rápido", // 203 "PS rápido", // 203
"Default" // 204 "Default", // 204
"Mute screen on\nXDRGTK connection" // 205
}, },
{ "Português", // Portuguese { "Português", // Portuguese
@@ -3729,7 +3746,8 @@ static const char* const myLanguage[18][205] = {
"Grande", // 201 "Grande", // 201
"Tudo", // 202 "Tudo", // 202
"PS rápido", // 203 "PS rápido", // 203
"Default" // 204 "Default", // 204
"Mute screen on\nXDRGTK connection" // 205
} }
}; };
#endif #endif