skip redrawing after touch cal to avoid hanging up

This commit is contained in:
TT 2017-02-03 19:54:00 +09:00
parent 5a63fe6890
commit c30a2730f3
2 changed files with 5 additions and 4 deletions

3
main.c
View file

@ -1220,6 +1220,7 @@ static void cmd_touchcal(BaseSequentialStream *chp, int argc, char *argv[])
//extern int16_t touch_cal[4]; //extern int16_t touch_cal[4];
int i; int i;
chMtxLock(&mutex);
chprintf(chp, "first touch upper left, then lower right..."); chprintf(chp, "first touch upper left, then lower right...");
touch_cal_exec(); touch_cal_exec();
chprintf(chp, "done\r\n"); chprintf(chp, "done\r\n");
@ -1229,7 +1230,7 @@ static void cmd_touchcal(BaseSequentialStream *chp, int argc, char *argv[])
chprintf(chp, "%d ", config.touch_cal[i]); chprintf(chp, "%d ", config.touch_cal[i]);
} }
chprintf(chp, "\r\n"); chprintf(chp, "\r\n");
touch_start_watchdog(); chMtxUnlock(&mutex);
} }
static void cmd_touchtest(BaseSequentialStream *chp, int argc, char *argv[]) static void cmd_touchtest(BaseSequentialStream *chp, int argc, char *argv[])

6
ui.c
View file

@ -293,7 +293,7 @@ touch_cal_exec(void)
do { do {
status = touch_check(); status = touch_check();
} while(status != EVT_TOUCH_PRESSED); } while(status != EVT_TOUCH_RELEASED);
x1 = last_touch_x; x1 = last_touch_x;
y1 = last_touch_y; y1 = last_touch_y;
@ -303,7 +303,7 @@ touch_cal_exec(void)
do { do {
status = touch_check(); status = touch_check();
} while(status != EVT_TOUCH_PRESSED); } while(status != EVT_TOUCH_RELEASED);
x2 = last_touch_x; x2 = last_touch_x;
y2 = last_touch_y; y2 = last_touch_y;
@ -312,8 +312,8 @@ touch_cal_exec(void)
config.touch_cal[2] = (x2 - x1) * 16 / 320; config.touch_cal[2] = (x2 - x1) * 16 / 320;
config.touch_cal[3] = (y2 - y1) * 16 / 240; config.touch_cal[3] = (y2 - y1) * 16 / 240;
//redraw_all();
touch_start_watchdog(); touch_start_watchdog();
redraw_all();
} }
void void