From eb0cc2187236fb0eac18bee536cf0d8f8cb7b7f8 Mon Sep 17 00:00:00 2001 From: inmarket Date: Mon, 13 Oct 2014 16:35:57 +1000 Subject: Tidy up MCU mouse defines --- drivers/ginput/touch/MCU/gmouse_lld_MCU.c | 15 ++++------ .../touch/MCU/gmouse_lld_MCU_board_template.h | 34 +++++++++------------- 2 files changed, 19 insertions(+), 30 deletions(-) (limited to 'drivers') diff --git a/drivers/ginput/touch/MCU/gmouse_lld_MCU.c b/drivers/ginput/touch/MCU/gmouse_lld_MCU.c index 222b759b..babf8bc3 100644 --- a/drivers/ginput/touch/MCU/gmouse_lld_MCU.c +++ b/drivers/ginput/touch/MCU/gmouse_lld_MCU.c @@ -15,11 +15,6 @@ // Get the hardware interface #include "gmouse_lld_MCU_board.h" -// If the board file doesn't specify how many extra bytes it wants - assume 0 -#ifndef BOARD_DATA_SIZE - #define BOARD_DATA_SIZE 0 -#endif - const GMouseVMT const GMOUSE_DRIVER_VMT[1] = {{ { GDRIVER_TYPE_TOUCH, @@ -28,13 +23,13 @@ const GMouseVMT const GMOUSE_DRIVER_VMT[1] = {{ // Extra flags for testing only //GMOUSE_VFLG_DEFAULTFINGER|GMOUSE_VFLG_CAL_EXTREMES - Possible //GMOUSE_VFLG_NOPOLL|GMOUSE_VFLG_DYNAMICONLY|GMOUSE_VFLG_SELFROTATION|GMOUSE_VFLG_CAL_LOADFREE - unlikely - sizeof(GMouse)+BOARD_DATA_SIZE, + sizeof(GMouse) + GMOUSE_MCU_BOARD_DATA_SIZE, _gmouseInitDriver, _gmousePostInitDriver, _gmouseDeInitDriver }, - Z_MAX, // z_max - Z_MIN, // z_min - Z_TOUCHON, // z_touchon - Z_TOUCHOFF, // z_touchoff + GMOUSE_MCU_Z_MAX, // z_max + GMOUSE_MCU_Z_MIN, // z_min + GMOUSE_MCU_Z_TOUCHON, // z_touchon + GMOUSE_MCU_Z_TOUCHOFF, // z_touchoff { // pen_jitter GMOUSE_MCU_PEN_CALIBRATE_ERROR, // calibrate GMOUSE_MCU_PEN_CLICK_ERROR, // click diff --git a/drivers/ginput/touch/MCU/gmouse_lld_MCU_board_template.h b/drivers/ginput/touch/MCU/gmouse_lld_MCU_board_template.h index 5366b16c..07583fa9 100644 --- a/drivers/ginput/touch/MCU/gmouse_lld_MCU_board_template.h +++ b/drivers/ginput/touch/MCU/gmouse_lld_MCU_board_template.h @@ -8,26 +8,20 @@ #ifndef _LLD_GMOUSE_MCU_BOARD_H #define _LLD_GMOUSE_MCU_BOARD_H -// Either define your jitter settings here or define them in the config include file -#if 0 - #include "gmouse_lld_MCU_config.h" -#else - #define GMOUSE_MCU_PEN_CALIBRATE_ERROR 2 - #define GMOUSE_MCU_PEN_CLICK_ERROR 2 - #define GMOUSE_MCU_PEN_MOVE_ERROR 2 - #define GMOUSE_MCU_FINGER_CALIBRATE_ERROR 4 - #define GMOUSE_MCU_FINGER_CLICK_ERROR 4 - #define GMOUSE_MCU_FINGER_MOVE_ERROR 4 -#endif - -// Now board specific settings... - -#define BOARD_DATA_SIZE 0 // How many extra bytes to add on the end of the mouse structure for the board's use - -#define Z_MIN 0 // The minimum Z reading -#define Z_MAX 100 // The maximum Z reading -#define Z_TOUCHON 80 // Values between this and Z_MAX are definitely pressed -#define Z_TOUCHOFF 70 // Values between this and Z_MIN are definitely not pressed +// Resolution and Accuracy Settings +#define GMOUSE_MCU_PEN_CALIBRATE_ERROR 8 +#define GMOUSE_MCU_PEN_CLICK_ERROR 6 +#define GMOUSE_MCU_PEN_MOVE_ERROR 4 +#define GMOUSE_MCU_FINGER_CALIBRATE_ERROR 14 +#define GMOUSE_MCU_FINGER_CLICK_ERROR 18 +#define GMOUSE_MCU_FINGER_MOVE_ERROR 14 +#define GMOUSE_MCU_Z_MIN 0 // The minimum Z reading +#define GMOUSE_MCU_Z_MAX 100 // The maximum Z reading +#define GMOUSE_MCU_Z_TOUCHON 80 // Values between this and Z_MAX are definitely pressed +#define GMOUSE_MCU_Z_TOUCHOFF 70 // Values between this and Z_MIN are definitely not pressed + +// How much extra data to allocate at the end of the GMouse structure for the board's use +#define GMOUSE_MCU_BOARD_DATA_SIZE 0 static bool_t init_board(GMouse *m, unsigned driverinstance) { } -- cgit v1.2.3