diff --git a/radio/src/gui/colorlcd/radio_diaganas.cpp b/radio/src/gui/colorlcd/radio_diaganas.cpp index 2ee85c4c1..37758d878 100644 --- a/radio/src/gui/colorlcd/radio_diaganas.cpp +++ b/radio/src/gui/colorlcd/radio_diaganas.cpp @@ -113,15 +113,16 @@ class RadioAnalogsDiagsWindow: public Window { #endif #if defined(HARDWARE_TOUCH) + TouchState rawTouchState = getInternalTouchState(); constexpr coord_t y = MENU_CONTENT_TOP + 5 * FH; - if (touchState.event != TE_NONE && touchState.event != TE_SLIDE_END) { + if (rawTouchState.event != TE_NONE && rawTouchState.event != TE_SLIDE_END) { coord_t x = dc->drawText(MENUS_MARGIN_LEFT, y, STR_TOUCH_PANEL); - x = dc->drawNumber(x + 5, y, touchState.x); + x = dc->drawNumber(x + 5, y, rawTouchState.x); x = dc->drawText(x, y, ":"); - dc->drawNumber(x, y, touchState.y); - dc->drawLine(touchState.x - 10, touchState.y - 8 - parent->top(), touchState.x + 10, touchState.y + 8 - parent->top(), SOLID, 0); - dc->drawLine(touchState.x - 10, touchState.y + 8 - parent->top(), touchState.x + 10, touchState.y - 8- parent->top(), SOLID, 0); + dc->drawNumber(x, y, rawTouchState.y); + dc->drawLine(rawTouchState.x - 10, rawTouchState.y - 8 - parent->top(), rawTouchState.x + 10, rawTouchState.y + 8 - parent->top(), SOLID, 0); + dc->drawLine(rawTouchState.x - 10, rawTouchState.y + 8 - parent->top(), rawTouchState.x + 10, rawTouchState.y - 8- parent->top(), SOLID, 0); } #if !defined(SIMU) && !defined(PCBNV14) constexpr coord_t y1 = MENU_CONTENT_TOP + 6 * FH; diff --git a/radio/src/targets/horus/tp_gt911.cpp b/radio/src/targets/horus/tp_gt911.cpp index 094f50297..86984d903 100644 --- a/radio/src/targets/horus/tp_gt911.cpp +++ b/radio/src/targets/horus/tp_gt911.cpp @@ -821,3 +821,9 @@ bool touchPanelEventOccured() { return touchEventOccured; } + +TouchState getInternalTouchState() +{ + return internalTouchState; +} + diff --git a/radio/src/targets/horus/tp_gt911.h b/radio/src/targets/horus/tp_gt911.h index 239ea1277..71bd430bb 100644 --- a/radio/src/targets/horus/tp_gt911.h +++ b/radio/src/targets/horus/tp_gt911.h @@ -32,6 +32,7 @@ extern bool touchPanelInit(); struct TouchState touchPanelRead(); bool touchPanelEventOccured(); +struct TouchState getInternalTouchState(); #define GT911_TIMEOUT 3 // 3ms diff --git a/radio/src/targets/nv14/board.h b/radio/src/targets/nv14/board.h index 0677593b3..45f92cc1a 100644 --- a/radio/src/targets/nv14/board.h +++ b/radio/src/targets/nv14/board.h @@ -554,5 +554,6 @@ extern AuxSerialRxFifo auxSerialRxFifo; // Touch panel driver bool touchPanelEventOccured(); struct TouchState touchPanelRead(); +struct TouchState getInternalTouchState(); #endif // _BOARD_H_ diff --git a/radio/src/targets/nv14/touch_driver.cpp b/radio/src/targets/nv14/touch_driver.cpp index 2e59acde0..fff2b3d62 100644 --- a/radio/src/targets/nv14/touch_driver.cpp +++ b/radio/src/targets/nv14/touch_driver.cpp @@ -557,3 +557,8 @@ TouchState touchPanelRead() internalTouchState.event = TE_NONE; return ret; } + +TouchState getInternalTouchState() +{ + return internalTouchState; +} diff --git a/radio/src/targets/simu/simpgmspace.cpp b/radio/src/targets/simu/simpgmspace.cpp index b5b5b5a4f..dbd5462de 100644 --- a/radio/src/targets/simu/simpgmspace.cpp +++ b/radio/src/targets/simu/simpgmspace.cpp @@ -915,4 +915,9 @@ struct TouchState touchPanelRead() simTouchState.deltaY = 0; return st; } + +struct TouchState getInternalTouchState() +{ + return simTouchState; +} #endif