From d9eaba249f7314b5946cfff19c3ba64215babb27 Mon Sep 17 00:00:00 2001 From: inmarket Date: Sat, 24 Feb 2018 12:36:15 +1000 Subject: [PATCH] Added support for specifying calibration fonts and text --- changelog.txt | 10 ++++++++++ gfxconf.example.h | 4 ++++ src/ginput/ginput_mouse.c | 28 ++++++++++++++++++++++------ 3 files changed, 36 insertions(+), 6 deletions(-) diff --git a/changelog.txt b/changelog.txt index 30501b36..26eb8be7 100644 --- a/changelog.txt +++ b/changelog.txt @@ -2,6 +2,16 @@ *** Releases *** ***************************************************************************** +*** After Release 2.8 *** +FEATURE: Added config vars GINPUT_TOUCH_CALIBRATION_FONT1 and GINPUT_TOUCH_CALIBRATION_FONT2 +FEATURE: Added config vars GINPUT_TOUCH_CALIBRATION_TITLE and GINPUT_TOUCH_CALIBRATION_ERROR +FIX: Fixed ensuring the clock is fully started in STM32LTDC based boards +FIX: Fixed compiler error in ST7735 driver +FIX: Added support for negative baseline_x in fonts +FIX: Fixed some word wrapping issues +FIX: Fixed drawing of 3x3 pixel boxes + + *** Release 2.8 *** FEATURE: Added support for 128x32 SSD1306 based displays FIX: Fixed recursion bug in console history diff --git a/gfxconf.example.h b/gfxconf.example.h index 208061e5..c5dd66ae 100644 --- a/gfxconf.example.h +++ b/gfxconf.example.h @@ -289,6 +289,10 @@ // #define GINPUT_TOUCH_USER_CALIBRATION_LOAD FALSE // #define GINPUT_TOUCH_USER_CALIBRATION_SAVE FALSE // #define GMOUSE_DRIVER_LIST GMOUSEVMT_Win32, GMOUSEVMT_Win32 +// #define GINPUT_TOUCH_CALIBRATION_FONT1 "* Double" +// #define GINPUT_TOUCH_CALIBRATION_FONT2 "* Narrow" +// #define GINPUT_TOUCH_CALIBRATION_TITLE "Calibration" +// #define GINPUT_TOUCH_CALIBRATION_ERROR "Calibration Failed!" //#define GINPUT_NEED_KEYBOARD FALSE // #define GINPUT_KEYBOARD_POLL_PERIOD 200 // #define GKEYBOARD_DRIVER_LIST GKEYBOARDVMT_Win32, GKEYBOARDVMT_Win32 diff --git a/src/ginput/ginput_mouse.c b/src/ginput/ginput_mouse.c index 58abfce2..f60faccb 100644 --- a/src/ginput/ginput_mouse.c +++ b/src/ginput/ginput_mouse.c @@ -23,8 +23,16 @@ #define CALIBRATION_MINPRESS_PERIOD 300 // milliseconds #define CALIBRATION_MAXPRESS_PERIOD 5000 // milliseconds -#define CALIBRATION_FONT "* Double" -#define CALIBRATION_FONT2 "* Narrow" +#ifdef GINPUT_TOUCH_CALIBRATION_FONT1 + #define CALIBRATION_FONT1 GINPUT_TOUCH_CALIBRATION_FONT1 +#else + #define CALIBRATION_FONT1 "* Double" +#endif +#ifdef GINPUT_TOUCH_CALIBRATION_FONT2 + #define CALIBRATION_FONT2 GINPUT_TOUCH_CALIBRATION_FONT2 +#else + #define CALIBRATION_FONT2 "* Narrow" +#endif #define CALIBRATION_BACKGROUND Blue #define CALIBRATION_CROSS_COLOR1 White @@ -32,13 +40,21 @@ #define CALIBRATION_CROSS_INNERGAP 2 #define CALIBRATION_CROSS_RADIUS 15 -#define CALIBRATION_TITLE "Calibration" +#ifdef GINPUT_TOUCH_CALIBRATION_TITLE + #define CALIBRATION_TITLE GINPUT_TOUCH_CALIBRATION_TITLE +#else + #define CALIBRATION_TITLE "Calibration" +#endif #define CALIBRATION_TITLE_Y 5 #define CALIBRATION_TITLE_HEIGHT 30 #define CALIBRATION_TITLE_COLOR White #define CALIBRATION_TITLE_BACKGROUND Blue -#define CALIBRATION_ERROR_TEXT "Calibration Failed!" +#ifdef GINPUT_TOUCH_CALIBRATION_ERROR + #define CALIBRATION_ERROR_TEXT GINPUT_TOUCH_CALIBRATION_ERROR +#else + #define CALIBRATION_ERROR_TEXT "Calibration Failed!" +#endif #define CALIBRATION_ERROR_DELAY 3000 #define CALIBRATION_ERROR_COLOR Red #define CALIBRATION_ERROR_BACKGROUND Yellow @@ -60,7 +76,7 @@ static GTIMER_DECL(MouseTimer); x = (coord_t) (c->ax * pt->x + c->bx * pt->y + c->cx); y = (coord_t) (c->ay * pt->x + c->by * pt->y + c->cy); - + pt->x = x; pt->y = y; } @@ -455,7 +471,7 @@ static void MousePoll(void *param) { #endif #if GDISP_NEED_TEXT - font1 = gdispOpenFont(CALIBRATION_FONT); + font1 = gdispOpenFont(CALIBRATION_FONT1); if (!font1) font1 = gdispOpenFont("*"); font2 = gdispOpenFont(CALIBRATION_FONT2); if (!font2) font2 = gdispOpenFont("*");