Added support for specifying calibration fonts and text

This commit is contained in:
inmarket 2018-02-24 12:36:15 +10:00
parent aeef03a83e
commit d9eaba249f
3 changed files with 36 additions and 6 deletions

View File

@ -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

View File

@ -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

View File

@ -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("*");