Add touch cancellation option
This commit is contained in:
parent
e6fa6f935b
commit
71e5f877da
|
@ -2,6 +2,7 @@
|
||||||
#include "nano_gui.h"
|
#include "nano_gui.h"
|
||||||
#include "colors.h"
|
#include "colors.h"
|
||||||
#include "pin_definitions.h"
|
#include "pin_definitions.h"
|
||||||
|
#include "push_button.h"
|
||||||
#include "scratch_space.h"
|
#include "scratch_space.h"
|
||||||
#include "settings.h"
|
#include "settings.h"
|
||||||
#include "touch.h"
|
#include "touch.h"
|
||||||
|
@ -116,7 +117,7 @@ void setupTouch(){
|
||||||
};
|
};
|
||||||
|
|
||||||
displayClear(DISPLAY_BLACK);
|
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);
|
displayText(b, 20,100, 200, 50, DISPLAY_WHITE, DISPLAY_BLACK, DISPLAY_BLACK);
|
||||||
|
|
||||||
Point cal_points[sizeof(CROSS_CORNER_POINTS)/sizeof(CROSS_CORNER_POINTS[0])];
|
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){
|
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);
|
drawCross(CROSS_CORNER_POINTS[i].x,CROSS_CORNER_POINTS[i].y,DISPLAY_WHITE);
|
||||||
while(!readTouch(&cal_points[i])){
|
while(!readTouch(&cal_points[i])){
|
||||||
|
if(ButtonPress_e::NotPressed != CheckTunerButton()){
|
||||||
|
return;
|
||||||
|
}
|
||||||
delay(100);
|
delay(100);
|
||||||
}
|
}
|
||||||
while(readTouch(&cal_points[i])){
|
while(readTouch(&cal_points[i])){
|
||||||
|
|
Loading…
Reference in New Issue