Merge pull request #121 from ohmytime/Rotating_while_screen_off

This commit is contained in:
Sjef Verhoeven PE5PVB
2023-07-26 13:34:43 +02:00
committed by GitHub
5 changed files with 10338 additions and 10080 deletions
+38 -41
View File
@@ -137,12 +137,12 @@ byte rdsblockold;
byte region;
byte regionold;
byte rotarymode;
byte touchrotating;
byte screensaverOptions[5] = {0, 3, 10, 30, 60};
byte screensaverset;
byte showmodulation;
byte showSWMIBand = 1;
byte showSWMIBand;
byte SNRold;
byte specialstepOIRT;
byte stepsize;
byte StereoLevel;
byte subnetclient;
@@ -360,7 +360,7 @@ void setup() {
amnb = EEPROM.readByte(EE_BYTE_AM_NB);
fmnb = EEPROM.readByte(EE_BYTE_FM_NB);
audiomode = EEPROM.readByte(EE_BYTE_AUDIOMODE);
specialstepOIRT = EEPROM.readByte(EE_BYTE_OIRT);
touchrotating = EEPROM.readByte(EE_BYTE_TOUCH_ROTATING);
// LowEdgeOIRTSet = EEPROM.readUInt(EE_UINT16_LOWEDGEOIRTSET);
// HighEdgeOIRTSet = EEPROM.readUInt(EE_UINT16_HIGHEDGEOIRTSET);
colorinvert = EEPROM.readByte(EE_BYTE_COLORINVERT);
@@ -746,8 +746,10 @@ void loop() {
if (rotary == -1) {
if (screensavertriggered) {
rotary = 0;
WakeToSleep(REVERSE);
if (!touchrotating) {
rotary = 0;
WakeToSleep(REVERSE);
}
} else {
KeyUp();
if (screensaverset && !menu && !screensavertriggered) ScreensaverTimerRestart();
@@ -755,8 +757,10 @@ void loop() {
}
if (rotary == 1) {
if (screensavertriggered) {
rotary = 0;
WakeToSleep(REVERSE);
if (!touchrotating) {
rotary = 0;
WakeToSleep(REVERSE);
}
} else {
KeyDown();
if (screensaverset && !menu && !screensavertriggered) ScreensaverTimerRestart();
@@ -795,9 +799,22 @@ void loop() {
}
}
} else {
if (rotary != 0) {
rotary = 0;
if (screensavertriggered) WakeToSleep(REVERSE);
if (rotary == -1) {
if (!touchrotating) {
rotary = 0;
WakeToSleep(REVERSE);
} else {
KeyUp();
}
}
if (rotary == 1) {
if (!touchrotating) {
rotary = 0;
WakeToSleep(REVERSE);
} else {
KeyDown();
}
}
}
}
@@ -1777,7 +1794,7 @@ void ModeButtonPress() {
EEPROM.writeByte(EE_BYTE_AM_NB, amnb);
EEPROM.writeByte(EE_BYTE_FM_NB, fmnb);
EEPROM.writeByte(EE_BYTE_AUDIOMODE, audiomode);
EEPROM.writeByte(EE_BYTE_OIRT, specialstepOIRT);
EEPROM.writeByte(EE_BYTE_TOUCH_ROTATING, touchrotating);
EEPROM.writeUInt(EE_UINT16_LOWEDGEOIRTSET, LowEdgeOIRTSet);
EEPROM.writeUInt(EE_UINT16_HIGHEDGEOIRTSET, HighEdgeOIRTSet);
EEPROM.writeByte(EE_BYTE_COLORINVERT, colorinvert);
@@ -2158,8 +2175,8 @@ void ButtonPress() {
break;
case 210:
tftPrint(0, myLanguage[language][68], 155, 78, ActiveColor, ActiveColorSmooth, FONT28);
if (specialstepOIRT) tftPrint(0, myLanguage[language][42], 155, 118, PrimaryColor, PrimaryColorSmooth, FONT28); else tftPrint(0, myLanguage[language][30], 155, 118, PrimaryColor, PrimaryColorSmooth, FONT28);
tftPrint(0, myLanguage[language][107], 155, 78, ActiveColor, ActiveColorSmooth, FONT28);
if (touchrotating) tftPrint(0, myLanguage[language][42], 155, 118, PrimaryColor, PrimaryColorSmooth, FONT28); else tftPrint(0, myLanguage[language][30], 155, 118, PrimaryColor, PrimaryColorSmooth, FONT28);
break;
}
break;
@@ -2330,10 +2347,6 @@ void KeyUp() {
tftPrint(1, String(LowEdgeSet / 10 + ConverterSet, DEC) + "." + String(LowEdgeSet % 10 + ConverterSet, DEC), 155, 118, BackgroundColor, BackgroundColor, FONT28);
LowEdgeSet ++;
if (LowEdgeSet > 1070) LowEdgeSet = 650;
if (specialstepOIRT) {
// FindlowStopOIRT();
// FindhighStopOIRT();
}
tftPrint(1, String(LowEdgeSet / 10 + ConverterSet, DEC) + "." + String(LowEdgeSet % 10 + ConverterSet, DEC), 155, 118, PrimaryColor, PrimaryColorSmooth, FONT28);
break;
@@ -2341,10 +2354,6 @@ void KeyUp() {
tftPrint(1, String(HighEdgeSet / 10 + ConverterSet, DEC) + "." + String(HighEdgeSet % 10 + ConverterSet, DEC), 155, 118, BackgroundColor, BackgroundColor, FONT28);
HighEdgeSet ++;
if (HighEdgeSet > 1080) HighEdgeSet = 660;
if (specialstepOIRT) {
// FindlowStopOIRT();
// FindhighStopOIRT();
}
tftPrint(1, String(HighEdgeSet / 10 + ConverterSet, DEC) + "." + String(HighEdgeSet % 10 + ConverterSet, DEC), 155, 118, PrimaryColor, PrimaryColorSmooth, FONT28);
break;
@@ -2544,15 +2553,9 @@ void KeyUp() {
break;
case 210:
if (specialstepOIRT) tftPrint(0, myLanguage[language][42], 155, 118, BackgroundColor, BackgroundColor, FONT28); else tftPrint(0, myLanguage[language][30], 155, 118, BackgroundColor, BackgroundColor, FONT28);
if (specialstepOIRT) {
specialstepOIRT = 0;
} else {
specialstepOIRT = 1;
// FindlowStopOIRT();
// FindhighStopOIRT();
}
if (specialstepOIRT) tftPrint(0, myLanguage[language][42], 155, 118, PrimaryColor, PrimaryColorSmooth, FONT28); else tftPrint(0, myLanguage[language][30], 155, 118, PrimaryColor, PrimaryColorSmooth, FONT28);
if (touchrotating) tftPrint(0, myLanguage[language][42], 155, 118, BackgroundColor, BackgroundColor, FONT28); else tftPrint(0, myLanguage[language][30], 155, 118, BackgroundColor, BackgroundColor, FONT28);
if (touchrotating) touchrotating = 0; else touchrotating = 1;
if (touchrotating) tftPrint(0, myLanguage[language][42], 155, 118, PrimaryColor, PrimaryColorSmooth, FONT28); else tftPrint(0, myLanguage[language][30], 155, 118, PrimaryColor, PrimaryColorSmooth, FONT28);
break;
}
break;
@@ -2936,15 +2939,9 @@ void KeyDown() {
radio.setAudio(audiomode);
break;
case 210:
if (specialstepOIRT) tftPrint(0, myLanguage[language][42], 155, 118, BackgroundColor, BackgroundColor, FONT28); else tftPrint(0, myLanguage[language][30], 155, 118, BackgroundColor, BackgroundColor, FONT28);
if (specialstepOIRT) {
specialstepOIRT = 0;
} else {
specialstepOIRT = 1;
// FindlowStopOIRT();
// FindhighStopOIRT();
}
if (specialstepOIRT) tftPrint(0, myLanguage[language][42], 155, 118, PrimaryColor, PrimaryColorSmooth, FONT28); else tftPrint(0, myLanguage[language][30], 155, 118, PrimaryColor, PrimaryColorSmooth, FONT28);
if (touchrotating) tftPrint(0, myLanguage[language][42], 155, 118, BackgroundColor, BackgroundColor, FONT28); else tftPrint(0, myLanguage[language][30], 155, 118, BackgroundColor, BackgroundColor, FONT28);
if (touchrotating) touchrotating = 0; else touchrotating = 1;
if (touchrotating) tftPrint(0, myLanguage[language][42], 155, 118, PrimaryColor, PrimaryColorSmooth, FONT28); else tftPrint(0, myLanguage[language][30], 155, 118, PrimaryColor, PrimaryColorSmooth, FONT28);
break;
}
break;
@@ -3747,7 +3744,7 @@ void BuildMenu() {
if (amnb != 0) tftPrint(1, String(amnb, DEC), 265, 156, PrimaryColor, PrimaryColorSmooth, FONT16); else tftPrint(1, myLanguage[language][30], 305, 156, PrimaryColor, PrimaryColorSmooth, FONT16);
if (fmnb != 0) tftPrint(1, String(fmnb, DEC), 265, 176, PrimaryColor, PrimaryColorSmooth, FONT16); else tftPrint(1, myLanguage[language][30], 305, 176, PrimaryColor, PrimaryColorSmooth, FONT16);
if (audiomode) tftPrint(1, "MPX", 305, 196, PrimaryColor, PrimaryColorSmooth, FONT16); else tftPrint(1, "Stereo", 305, 196, PrimaryColor, PrimaryColorSmooth, FONT16);
if (specialstepOIRT) tftPrint(1, myLanguage[language][42], 305, 216, PrimaryColor, PrimaryColorSmooth, FONT16); else tftPrint(1, myLanguage[language][30], 305, 216, PrimaryColor, PrimaryColorSmooth, FONT16);
if (touchrotating) tftPrint(1, myLanguage[language][42], 305, 216, PrimaryColor, PrimaryColorSmooth, FONT16); else tftPrint(1, myLanguage[language][30], 305, 216, PrimaryColor, PrimaryColorSmooth, FONT16);
break;
case 4:
@@ -5915,7 +5912,7 @@ void DefaultSettings() {
EEPROM.writeByte(EE_BYTE_AM_NB, 0);
EEPROM.writeByte(EE_BYTE_FM_NB, 0);
EEPROM.writeByte(EE_BYTE_AUDIOMODE, 0);
EEPROM.writeByte(EE_BYTE_OIRT, 0);
EEPROM.writeByte( EE_BYTE_TOUCH_ROTATING, 0);
EEPROM.writeUInt(EE_UINT16_LOWEDGEOIRTSET, 0);
EEPROM.writeUInt(EE_UINT16_HIGHEDGEOIRTSET, 0);
EEPROM.writeByte(EE_BYTE_COLORINVERT, 0);
+2808 -2741
View File
File diff suppressed because it is too large Load Diff
+7445 -7266
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -152,7 +152,7 @@
#define EE_BYTE_AM_NB 246
#define EE_BYTE_FM_NB 247
#define EE_BYTE_AUDIOMODE 248
#define EE_BYTE_OIRT 249
#define EE_BYTE_TOUCH_ROTATING 249
#define EE_UINT16_LOWEDGEOIRTSET 250
#define EE_UINT16_HIGHEDGEOIRTSET 254
#define EE_BYTE_COLORINVERT 258
+46 -31
View File
@@ -1,6 +1,6 @@
// [number of languages][number of texts][max. length of text]
static const char* const myLanguage[15][107] = {
static const char* const myLanguage[15][108] = {
{ "English", // English
"Rotary direction changed", // 1
"Please release button", // 2
@@ -69,7 +69,7 @@ static const char* const myLanguage[15][107] = {
"FM Noise blanker", // 65
"Defaults loaded", // 66
"Audio output", // 67
"FM OIRT 30 kHz steps", // 68
"Touch rotating", // 68 for translation reference to commputer Touch Typing
"Invert display", // 69
"About software", // 70
"Main code:", // 71
@@ -107,7 +107,8 @@ static const char* const myLanguage[15][107] = {
"MW", // 103
"SW", // 104
"FM", // 105
"OIRT" // 106
"OIRT", // 106
"Rotating while screen off" // 107
},
{ "Nederlands", // Dutch
@@ -178,7 +179,7 @@ static const char* const myLanguage[15][107] = {
"FM ruis filter", // 65
"Opnieuw geconfigureerd", // 66
"Audio uitgang", // 67
"FM OIRT 30 kHz steps", // 68
"Touch rotating", // 68 for translation reference to commputer Touch Typing
"Inverteer scherm", // 69
"Over deze software", // 70
"Basis code:", // 71
@@ -216,7 +217,8 @@ static const char* const myLanguage[15][107] = {
"MW", // 103
"SW", // 104
"FM", // 105
"OIRT" // 106
"OIRT", // 106
"Rotating while screen off" // 107
},
{ "Polski", // Polish
@@ -287,7 +289,7 @@ static const char* const myLanguage[15][107] = {
"Reduktor szumow FM", // 65
"Zaladowano domyslne", // 66
"Wyjscie dzwieku", // 67
"Kroki co 30 kHz na OIRT", // 68
"Touch rotating", // 68 for translation reference to commputer Touch Typing
"Odwroc kolory wyswietlacza", // 69
"O oprogramowaniu", // 70
"Glowny kod:", // 71
@@ -325,7 +327,8 @@ static const char* const myLanguage[15][107] = {
"MW", // 103
"SW", // 104
"FM", // 105
"OIRT" // 106
"OIRT", // 106
"Rotating while screen off" // 107
},
{ "Hrvatski", // Croatian
@@ -396,7 +399,7 @@ static const char* const myLanguage[15][107] = {
"FM prigušivač šuma", // 65
"Zadane postavke učitane", // 66
"Audio izlaz", // 67
"FM OIRT 30 kHz koraci", // 68
"Touch rotating", // 68 for translation reference to commputer Touch Typing
"Invertiraj boju zaslona", // 69
"O softveru", // 70
"Glavni izvorni kod:", // 71
@@ -434,7 +437,8 @@ static const char* const myLanguage[15][107] = {
"MW", // 103
"SW", // 104
"FM", // 105
"OIRT" // 106
"OIRT", // 106
"Rotating while screen off" // 107
},
{ "Ελληνικά", // Greek
@@ -505,7 +509,7 @@ static const char* const myLanguage[15][107] = {
"Απαλοιφή θορύβου FM", // 65
"Οι προεπιλογές φορτώθηκαν", // 66
"Έξοδος ήχου", // 67
"FM OIRT βήματα 30 kHz", // 68
"Touch rotating", // 68 for translation reference to commputer Touch Typing
"Αναστροφή χρωμάτων οθόνης", // 69
"Πληροφορίες λογισμικού", // 70
"Κύριος κώδικας:", // 71
@@ -543,7 +547,8 @@ static const char* const myLanguage[15][107] = {
"MW", // 103
"SW", // 104
"FM", // 105
"OIRT" // 106
"OIRT", // 106
"Rotating while screen off" // 107
},
{ "Romana", // Romanian
@@ -614,7 +619,7 @@ static const char* const myLanguage[15][107] = {
"FM Noise blanker", // 65
"Defaults loaded", // 66
"Audio output", // 67
"FM OIRT 30 kHz steps", // 68
"Touch rotating", // 68 for translation reference to commputer Touch Typing
"Display color invert", // 69
"About software", // 70
"Main code:", // 71
@@ -652,7 +657,8 @@ static const char* const myLanguage[15][107] = {
"MW", // 103
"SW", // 104
"FM", // 105
"OIRT" // 106
"OIRT", // 106
"Rotating while screen off" // 107
},
{ "Deutsch", // German
@@ -723,7 +729,7 @@ static const char* const myLanguage[15][107] = {
"UKW Rauschunterdrückung", // 65
"Werkseinstellung geladen", // 66
"Audioausgabe", // 67
"30 kHz Schritte auf OIRT", // 68
"Touch rotating", // 68 for translation reference to commputer Touch Typing
"Anzeigefarben umkehren", // 69
"Über diese Software", // 70
"Hauptcode:", // 71
@@ -761,7 +767,8 @@ static const char* const myLanguage[15][107] = {
"MW", // 103
"KW", // 104
"UKW", // 105
"OIRT" // 106
"OIRT", // 106
"Rotating while screen off" // 107
},
{ "Czech", // Czech
@@ -832,7 +839,7 @@ static const char* const myLanguage[15][107] = {
"FM Noise blanker", // 65
"Defaults loaded", // 66
"Audio output", // 67
"FM OIRT 30 kHz steps", // 68
"Touch rotating", // 68 for translation reference to commputer Touch Typing
"Display color invert", // 69
"About software", // 70
"Main code:", // 71
@@ -870,7 +877,8 @@ static const char* const myLanguage[15][107] = {
"MW", // 103
"SW", // 104
"FM", // 105
"OIRT" // 106
"OIRT", // 106
"Rotating while screen off" // 107
},
{ "Slovak", // Slovak
@@ -941,7 +949,7 @@ static const char* const myLanguage[15][107] = {
"FM Noise blanker", // 65
"Defaults loaded", // 66
"Audio output", // 67
"FM OIRT 30 kHz steps", // 68
"Touch rotating", // 68 for translation reference to commputer Touch Typing
"Display color invert", // 69
"About software", // 70
"Main code:", // 71
@@ -979,7 +987,8 @@ static const char* const myLanguage[15][107] = {
"MW", // 103
"SW", // 104
"FM", // 105
"OIRT" // 106
"OIRT", // 106
"Rotating while screen off" // 107
},
{ "Français", // French
@@ -1050,7 +1059,7 @@ static const char* const myLanguage[15][107] = {
"Réducteur de bruit FM", // 65
"Paramètres par défaut chargés", // 66
"Sortie audio", // 67
"Pas de 30 kHz pour la bande OIRT", // 68
"Touch rotating", // 68 for translation reference to commputer Touch Typing
"Inverser l'affichage", // 69
"À propos du logiciel", // 70
"Code principal :", // 71
@@ -1088,7 +1097,8 @@ static const char* const myLanguage[15][107] = {
"MW", // 103
"SW", // 104
"FM", // 105
"OIRT" // 106
"OIRT", // 106
"Rotating while screen off" // 107
},
{ "Български", // Bulgarian
@@ -1159,7 +1169,7 @@ static const char* const myLanguage[15][107] = {
"FM заглушител на шума", // 65
"Фабр. настройки бяха зададени", // 66
"Аудио Изход", // 67
"FM OIRT 30 kHz стъпки", // 68
"Touch rotating", // 68 for translation reference to commputer Touch Typing
"Обръщане на дисплея", // 69
"Относно софтуера", // 70
"Главен код:", // 71
@@ -1197,7 +1207,8 @@ static const char* const myLanguage[15][107] = {
"MW", // 103
"SW", // 104
"FM", // 105
"OIRT" // 106
"OIRT", // 106
"Rotating while screen off" // 107
},
{ "Русский", // Russian
@@ -1268,7 +1279,7 @@ static const char* const myLanguage[15][107] = {
"Шумоподавитель FM", // 65
"Загрузка настроек по умолчанию", // 66
"Аудиовыход", // 67
"FM OIRT с шагом 30 кГц", // 68
"Touch rotating", // 68 for translation reference to commputer Touch Typing
"Инвертировать дисплей", // 69
"О программе", // 70
"Основной код:", // 71
@@ -1306,7 +1317,8 @@ static const char* const myLanguage[15][107] = {
"MW", // 103
"SW", // 104
"FM", // 105
"OIRT" // 106
"OIRT", // 106
"Rotating while screen off" // 107
},
{ "Українська", // Ukranian
@@ -1377,7 +1389,7 @@ static const char* const myLanguage[15][107] = {
"Помпи засліплення шуму FM", // 65
"Завантажено параметри за замовчуванням", // 66
"Аудіо вихід", // 67
"FM OIRT 30 кГц кроки", // 68
"Touch rotating", // 68 for translation reference to commputer Touch Typing
"Перевернути дисплей", // 69
"Про програмне забезпечення", // 70
"Основний код:", // 71
@@ -1415,7 +1427,8 @@ static const char* const myLanguage[15][107] = {
"MW", // 103
"SW", // 104
"FM", // 105
"OIRT" // 106
"OIRT", // 106
"Rotating while screen off" // 107
},
{ "Italiano", // Italian
@@ -1486,7 +1499,7 @@ static const char* const myLanguage[15][107] = {
"Soppressione rumore FM", // 65
"Predefiniti caricati", // 66
"Uscita audio", // 67
"Passo 30 kHz per FM OIRT", // 68
"Touch rotating", // 68 for translation reference to commputer Touch Typing
"Inversione schermo", // 69
"Info sul software", // 70
"Codice principale:", // 71
@@ -1524,7 +1537,8 @@ static const char* const myLanguage[15][107] = {
"MW", // 103
"SW", // 104
"FM", // 105
"OIRT" // 106
"OIRT", // 106
"Rotating while screen off" // 107
},
{ "Simplified Chinese", // Simplified Chinese
@@ -1595,7 +1609,7 @@ static const char* const myLanguage[15][107] = {
"FM 噪声消除", // 65
"恢复出厂设置", // 66
"音频输出选择", // 67
"FM OIRT 30 kHz steps", // 68
"盲操", // 68
"LCD颜色反转", // 69
"关于(About)", // 70
"主程序:", // 71
@@ -1633,7 +1647,8 @@ static const char* const myLanguage[15][107] = {
"MW", // 103
"SW", // 104
"FM", // 105
"OIRT" // 106
"OIRT", // 106
"熄屏操作飞梭" // 107
}
};