From 71e5f877da58cf5a18e36b9dcb78c1cf1b008a25 Mon Sep 17 00:00:00 2001 From: Reed Nightingale Date: Tue, 5 May 2020 21:32:30 -0700 Subject: [PATCH] Add touch cancellation option --- nano_gui.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nano_gui.cpp b/nano_gui.cpp index e1e0151..821d1d7 100644 --- a/nano_gui.cpp +++ b/nano_gui.cpp @@ -2,6 +2,7 @@ #include "nano_gui.h" #include "colors.h" #include "pin_definitions.h" +#include "push_button.h" #include "scratch_space.h" #include "settings.h" #include "touch.h" @@ -116,7 +117,7 @@ void setupTouch(){ }; displayClear(DISPLAY_BLACK); - strncpy_P(b,(const char*)F("Click on the cross"),sizeof(b)); + strncpy_P(b,(const char*)F("Click on the cross\nPush tune to cancel"),sizeof(b)); displayText(b, 20,100, 200, 50, DISPLAY_WHITE, DISPLAY_BLACK, DISPLAY_BLACK); Point cal_points[sizeof(CROSS_CORNER_POINTS)/sizeof(CROSS_CORNER_POINTS[0])]; @@ -124,6 +125,9 @@ void setupTouch(){ for(uint8_t i = 0; i < sizeof(CROSS_CORNER_POINTS)/sizeof(CROSS_CORNER_POINTS[0]); ++i){ drawCross(CROSS_CORNER_POINTS[i].x,CROSS_CORNER_POINTS[i].y,DISPLAY_WHITE); while(!readTouch(&cal_points[i])){ + if(ButtonPress_e::NotPressed != CheckTunerButton()){ + return; + } delay(100); } while(readTouch(&cal_points[i])){