diff options
author | inmarket <andrewh@inmarket.com.au> | 2014-11-15 15:22:09 +1000 |
---|---|---|
committer | inmarket <andrewh@inmarket.com.au> | 2014-11-15 15:22:09 +1000 |
commit | fe00d3e090a8197b86c278d548a8f069bcca348d (patch) | |
tree | d94dad28d44791944ebb7e6de8e820fe994a1e3c /src/ginput/ginput_mouse.c | |
parent | a8d6aa079056d14ce8d207f8dcf1ed527c0b5ca9 (diff) | |
download | uGFX-fe00d3e090a8197b86c278d548a8f069bcca348d.tar.gz uGFX-fe00d3e090a8197b86c278d548a8f069bcca348d.tar.bz2 uGFX-fe00d3e090a8197b86c278d548a8f069bcca348d.zip |
Change the definition of the calibration load and save routines as per steved suggestion.
Diffstat (limited to 'src/ginput/ginput_mouse.c')
-rw-r--r-- | src/ginput/ginput_mouse.c | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/src/ginput/ginput_mouse.c b/src/ginput/ginput_mouse.c index 570839a2..fcaa53b8 100644 --- a/src/ginput/ginput_mouse.c +++ b/src/ginput/ginput_mouse.c @@ -462,7 +462,7 @@ static void MousePoll(void *param) { gdispGSetClip(m->display, 0, 0, w, h); #endif - // Ensure we get minimaly processed readings for the calibration + // Ensure we get minimally processed readings for the calibration m->flags |= GMOUSE_FLG_IN_CAL; // Set up our calibration locations @@ -519,7 +519,7 @@ static void MousePoll(void *param) { gfxSleepMilliseconds(CALIBRATION_POLL_PERIOD); } - // Ignore presses less than CALIBRATION_MAXPRESS_PERIOD milliseconds + // Ignore presses less than CALIBRATION_MINPRESS_PERIOD milliseconds } while(j < CALIBRATION_MINPRESS_PERIOD/CALIBRATION_POLL_PERIOD); points[i].x = px / j; points[i].y = py / j; @@ -689,23 +689,13 @@ void _gmousePostInitDriver(GDriver *g) { #if !GINPUT_TOUCH_NOCALIBRATE && !GINPUT_TOUCH_STARTRAW if ((gmvmt(m)->d.flags & GMOUSE_VFLG_CALIBRATE)) { - GMouseCalibration *pc; - #if GINPUT_TOUCH_USER_CALIBRATION_LOAD - if ((pc = (GMouseCalibration *)LoadMouseCalibration(gdriverGetDriverInstanceNumber((GDriver *)m), sizeof(GMouseCalibration)))) { - memcpy(&m->caldata, pc, sizeof(GMouseCalibration)); - #if GINPUT_TOUCH_USER_CALIBRATION_FREE - gfxFree(pc); - #endif + if (LoadMouseCalibration(gdriverGetDriverInstanceNumber((GDriver *)m), &m->caldata, sizeof(GMouseCalibration)))) m->flags |= GMOUSE_FLG_CALIBRATE; - } else + else #endif - if (gmvmt(m)->calload && (pc = (GMouseCalibration *)gmvmt(m)->calload(m, sizeof(GMouseCalibration)))) { - memcpy(&m->caldata, pc, sizeof(GMouseCalibration)); - if ((gmvmt(m)->d.flags & GMOUSE_VFLG_CAL_LOADFREE)) - gfxFree(pc); + if (gmvmt(m)->calload && gmvmt(m)->calload(m, &m->caldata, sizeof(GMouseCalibration)))) m->flags |= GMOUSE_FLG_CALIBRATE; - } #if !GINPUT_TOUCH_NOCALIBRATE_GUI else while (CalibrateMouse(m)); |