From 9e268eba8954b1a7b13bbc3018ecb1b8ccf7ae8e Mon Sep 17 00:00:00 2001 From: Max Paperno Date: Sun, 12 Feb 2017 17:10:19 -0500 Subject: [PATCH] [128x64] Fix switch diagnostics display on 9X family. (#4176) --- radio/src/gui/128x64/radio_diagkeys.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/radio/src/gui/128x64/radio_diagkeys.cpp b/radio/src/gui/128x64/radio_diagkeys.cpp index a72b9c6c4..25447c1ef 100644 --- a/radio/src/gui/128x64/radio_diagkeys.cpp +++ b/radio/src/gui/128x64/radio_diagkeys.cpp @@ -26,6 +26,14 @@ void displayKeyState(uint8_t x, uint8_t y, uint8_t key) lcdDrawChar(x, y, t+'0', t ? INVERS : 0); } +#if !defined(PCBTARANIS) +void displaySwitchState(uint8_t x, uint8_t y, uint8_t sw) +{ + swsrc_t t = switchState(sw); + lcdDrawChar(x, y, (t ? '1' : '0'), t ? INVERS : 0); +} +#endif + void menuRadioDiagKeys(event_t event) { SIMPLE_MENU(STR_MENU_RADIO_SWITCHES, menuTabGeneral, MENU_RADIO_SWITCHES_TEST, 1); @@ -59,7 +67,7 @@ void menuRadioDiagKeys(event_t event) if (i != SW_ID0) { y = MENU_HEADER_HEIGHT +i*FH - 2*FH; drawSwitch(8*FW, y, i+1, 0); - displayKeyState(11*FW+2, y, i); + displaySwitchState(11*FW+2, y, i); } #endif }