Optimised screenmute function

This commit is contained in:
Sjef Verhoeven PE5PVB
2023-07-12 19:53:04 +02:00
parent b6aac643ac
commit c678b6c86a
+3 -5
View File
@@ -3612,8 +3612,8 @@ void BuildMenu() {
analogWrite(SMETERPIN, 0); analogWrite(SMETERPIN, 0);
} }
void MuteScreen(int setting) { void MuteScreen(bool setting) {
if (setting == 0 && screenmute == 1) { if (!setting && screenmute) {
screenmute = false; screenmute = false;
setupmode = true; setupmode = true;
tft.writecommand(0x11); tft.writecommand(0x11);
@@ -3621,9 +3621,7 @@ void MuteScreen(int setting) {
radio.clearRDS(fullsearchrds); radio.clearRDS(fullsearchrds);
BuildDisplay(); BuildDisplay();
setupmode = false; setupmode = false;
} } else if (setting && !screenmute) {
if (setting == 1 && screenmute == 0) {
screenmute = true; screenmute = true;
analogWrite(CONTRASTPIN, 0); analogWrite(CONTRASTPIN, 0);
tft.writecommand(0x10); tft.writecommand(0x10);