From f70f247302d735f954ea8ebc2e531f49f97d38ec Mon Sep 17 00:00:00 2001 From: Peter Feerick Date: Sat, 11 Sep 2021 18:43:13 +1000 Subject: [PATCH] Catch press and hold state --- radio/src/targets/nv14/touch_driver.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/radio/src/targets/nv14/touch_driver.cpp b/radio/src/targets/nv14/touch_driver.cpp index 7823d364e..14def7ee8 100644 --- a/radio/src/targets/nv14/touch_driver.cpp +++ b/radio/src/targets/nv14/touch_driver.cpp @@ -524,7 +524,7 @@ void touchPanelRead() if (ft6x06_TS_DetectTouch(TOUCH_FT6236_I2C_ADDRESS)) { handleTouch(); - if (touchState.event == TE_DOWN) + if (touchState.event == TE_DOWN && downTime == 0) downTime = now; } else { @@ -537,9 +537,11 @@ void touchPanelRead() tapCount++; touchState.tapCount = tapCount; tapTime = now; + } else { + touchState.tapCount = 0; //not a tap } - } - else { + downTime = 0; + } else { touchState.x = LCD_WIDTH; touchState.y = LCD_HEIGHT; touchState.event = TE_SLIDE_END;