From 541b5e8f3ccc8fe50ef35503da7f434430879564 Mon Sep 17 00:00:00 2001 From: 3djc Date: Sat, 25 Apr 2020 13:43:51 +0200 Subject: [PATCH] Fixes --- radio/src/gui/480x272/radio_diaganas.cpp | 6 ++---- radio/src/targets/horus/tp_gt911.h | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/radio/src/gui/480x272/radio_diaganas.cpp b/radio/src/gui/480x272/radio_diaganas.cpp index 905987fef..a5bd127b6 100644 --- a/radio/src/gui/480x272/radio_diaganas.cpp +++ b/radio/src/gui/480x272/radio_diaganas.cpp @@ -62,17 +62,15 @@ bool menuRadioDiagAnalogs(event_t event) #endif #if defined(HARDWARE_TOUCH) - if (touchGT911Flag) { + if (!touchGT911Flag) { lcdDrawText(MENUS_MARGIN_LEFT, MENU_CONTENT_TOP + 7 * FH, "Touch panel:"); } if (touchPanelEvent) { - uint8_t tmp,mode = 0; - gt911ReadRegister(GT911_READ_XY_REG,&mode,1); //read status + touchPanelRead(); lcdDrawNumber(lcdNextPos + 1, MENU_CONTENT_TOP + 7 * FH, touchState.x); lcdDrawText(MENUS_MARGIN_LEFT, MENU_CONTENT_TOP + 7 * FH, ", "); lcdDrawNumber(lcdNextPos + 1, MENU_CONTENT_TOP + 7 * FH, touchState.y); - gt911WriteRegister(GT911_CLEARBUF_REG, &tmp, 1); } #endif diff --git a/radio/src/targets/horus/tp_gt911.h b/radio/src/targets/horus/tp_gt911.h index 294de897e..fbccc4f24 100644 --- a/radio/src/targets/horus/tp_gt911.h +++ b/radio/src/targets/horus/tp_gt911.h @@ -36,7 +36,7 @@ extern uint8_t touchPanelEvent; uint8_t gt911WriteRegister(uint16_t reg, uint8_t * buf, uint8_t len); void gt911ReadRegister(uint16_t reg, uint8_t * buf, uint8_t len); - +void touchPanelRead(); //GT911 param table const uint8_t GT911_Cfg[]= //