[touch] Fix hardware touch diagnostics regression (#1314)

* fix touch screen test in analog input test screen

* remove #if SIMU check for touch test

* remove unneeded trace
This commit is contained in:
Malte Langermann
2021-12-30 11:46:10 +10:00
committed by GitHub
parent 1fa27e89ac
commit 9e285b3cb2
6 changed files with 24 additions and 5 deletions
+6 -5
View File
@@ -113,15 +113,16 @@ class RadioAnalogsDiagsWindow: public Window {
#endif #endif
#if defined(HARDWARE_TOUCH) #if defined(HARDWARE_TOUCH)
TouchState rawTouchState = getInternalTouchState();
constexpr coord_t y = MENU_CONTENT_TOP + 5 * FH; 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); 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, ":"); x = dc->drawText(x, y, ":");
dc->drawNumber(x, y, touchState.y); dc->drawNumber(x, y, rawTouchState.y);
dc->drawLine(touchState.x - 10, touchState.y - 8 - parent->top(), touchState.x + 10, touchState.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);
dc->drawLine(touchState.x - 10, touchState.y + 8 - parent->top(), touchState.x + 10, touchState.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) #if !defined(SIMU) && !defined(PCBNV14)
constexpr coord_t y1 = MENU_CONTENT_TOP + 6 * FH; constexpr coord_t y1 = MENU_CONTENT_TOP + 6 * FH;
+6
View File
@@ -821,3 +821,9 @@ bool touchPanelEventOccured()
{ {
return touchEventOccured; return touchEventOccured;
} }
TouchState getInternalTouchState()
{
return internalTouchState;
}
+1
View File
@@ -32,6 +32,7 @@ extern bool touchPanelInit();
struct TouchState touchPanelRead(); struct TouchState touchPanelRead();
bool touchPanelEventOccured(); bool touchPanelEventOccured();
struct TouchState getInternalTouchState();
#define GT911_TIMEOUT 3 // 3ms #define GT911_TIMEOUT 3 // 3ms
+1
View File
@@ -554,5 +554,6 @@ extern AuxSerialRxFifo auxSerialRxFifo;
// Touch panel driver // Touch panel driver
bool touchPanelEventOccured(); bool touchPanelEventOccured();
struct TouchState touchPanelRead(); struct TouchState touchPanelRead();
struct TouchState getInternalTouchState();
#endif // _BOARD_H_ #endif // _BOARD_H_
+5
View File
@@ -557,3 +557,8 @@ TouchState touchPanelRead()
internalTouchState.event = TE_NONE; internalTouchState.event = TE_NONE;
return ret; return ret;
} }
TouchState getInternalTouchState()
{
return internalTouchState;
}
+5
View File
@@ -915,4 +915,9 @@ struct TouchState touchPanelRead()
simTouchState.deltaY = 0; simTouchState.deltaY = 0;
return st; return st;
} }
struct TouchState getInternalTouchState()
{
return simTouchState;
}
#endif #endif