[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:
@@ -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;
|
||||
|
||||
@@ -821,3 +821,9 @@ bool touchPanelEventOccured()
|
||||
{
|
||||
return touchEventOccured;
|
||||
}
|
||||
|
||||
TouchState getInternalTouchState()
|
||||
{
|
||||
return internalTouchState;
|
||||
}
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ extern bool touchPanelInit();
|
||||
|
||||
struct TouchState touchPanelRead();
|
||||
bool touchPanelEventOccured();
|
||||
struct TouchState getInternalTouchState();
|
||||
|
||||
#define GT911_TIMEOUT 3 // 3ms
|
||||
|
||||
|
||||
@@ -554,5 +554,6 @@ extern AuxSerialRxFifo auxSerialRxFifo;
|
||||
// Touch panel driver
|
||||
bool touchPanelEventOccured();
|
||||
struct TouchState touchPanelRead();
|
||||
struct TouchState getInternalTouchState();
|
||||
|
||||
#endif // _BOARD_H_
|
||||
|
||||
@@ -557,3 +557,8 @@ TouchState touchPanelRead()
|
||||
internalTouchState.event = TE_NONE;
|
||||
return ret;
|
||||
}
|
||||
|
||||
TouchState getInternalTouchState()
|
||||
{
|
||||
return internalTouchState;
|
||||
}
|
||||
|
||||
@@ -915,4 +915,9 @@ struct TouchState touchPanelRead()
|
||||
simTouchState.deltaY = 0;
|
||||
return st;
|
||||
}
|
||||
|
||||
struct TouchState getInternalTouchState()
|
||||
{
|
||||
return simTouchState;
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user