phofman Posted May 21, 2017 Report Share Posted May 21, 2017 Hi, My cheap touch screen requires the extreme touch calibration for reasonable performance closer to the border. Please what is the recommended way to switch the initial calibration to the extreme version https://git.ugfx.io/Tectu/uGFX/src/master/src/ginput/ginput_mouse.c#L474 ? Please where is the recommended place to configure the GMOUSE_VFLG_CAL_EXTREMES flag to the GMouseVMT struct? I do not want to modify the library. May I ask for removing the old not valid configuration https://wiki.ugfx.io/index.php/Touchscreen_Calibration#Extreme_coordinates from the wiki? It is a bit confusing. Thanks a lot, Pavel. Link to comment Share on other sites More sharing options...
inmarket Posted May 22, 2017 Report Share Posted May 22, 2017 The wiki should be correct I think for most touch drivers. Note this belongs in your mouse board file (not the general gfxconf.h file). In the mouse driver itself it should use that board specified macro to set the extreme calibration flag in the drivers VMT flags when it is defining the VMT structure. It is possible that the mouse driver you are using has not implented that - if so let us know and we will fix it. I would have checked for you but you didn't mention which touch driver you are using. Link to comment Share on other sites More sharing options...
phofman Posted May 22, 2017 Author Report Share Posted May 22, 2017 Hi, thanks a lot. I do not think that define is being used/queried anywhere within the ugfx source: pavel@x220 ~/workspace/ChibiOS_16.1.8/demos/STM32/MAPLEMINI-UGFX/ugfx $ rgrep GINPUT_MOUSE_MAX_CALIBRATION_ERROR * drivers/multiple/uGFXnetESP8266/ginput_lld_mouse_config.h: #define GINPUT_MOUSE_MAX_CALIBRATION_ERROR -1 drivers/multiple/uGFXnetESP8266/ginput_lld_mouse_config.h: #define GINPUT_MOUSE_MAX_CALIBRATION_ERROR 2 drivers/multiple/uGFXnet/ginput_lld_mouse_config.h: #define GINPUT_MOUSE_MAX_CALIBRATION_ERROR -1 drivers/multiple/uGFXnet/ginput_lld_mouse_config.h: #define GINPUT_MOUSE_MAX_CALIBRATION_ERROR 2 There is a post by Joel My driver is the very standard ADS7843. I do not see setting the GMOUSE_VFLG_CAL_EXTREMES flag anywhere in the source code either, only reading/checking: pavel@x220 ~/workspace/ChibiOS_16.1.8/demos/STM32/MAPLEMINI-UGFX/ugfx $ rgrep GMOUSE_VFLG_CAL_EXTREMES * drivers/ginput/touch/MCU/gmouse_lld_MCU.c: //GMOUSE_VFLG_DEFAULTFINGER|GMOUSE_VFLG_CAL_EXTREMES - Possible drivers/multiple/uGFXnetESP8266/gdisp_lld_uGFXnetESP8266.cpp: //GMOUSE_VFLG_CALIBRATE|GMOUSE_VFLG_CAL_EXTREMES|GMOUSE_VFLG_CAL_TEST|GMOUSE_VFLG_CAL_LOADFREE drivers/multiple/Win32/gdisp_lld_Win32.c: //GMOUSE_VFLG_CALIBRATE|GMOUSE_VFLG_CAL_EXTREMES|GMOUSE_VFLG_CAL_TEST|GMOUSE_VFLG_CAL_LOADFREE drivers/multiple/uGFXnet/gdisp_lld_uGFXnet.c: //GMOUSE_VFLG_CALIBRATE|GMOUSE_VFLG_CAL_EXTREMES|GMOUSE_VFLG_CAL_TEST|GMOUSE_VFLG_CAL_LOADFREE drivers/multiple/X/gdisp_lld_X.c: //GMOUSE_VFLG_CALIBRATE|GMOUSE_VFLG_CAL_EXTREMES|GMOUSE_VFLG_CAL_TEST|GMOUSE_VFLG_CAL_LOADFREE src/ginput/ginput_driver_mouse.h: #define GMOUSE_VFLG_CAL_EXTREMES 0x0020 // Use edge to edge calibration src/ginput/ginput_mouse.c: //if ((gmvmt(m)->d.flags & GMOUSE_VFLG_CAL_EXTREMES)) { I appreciate your help. Link to comment Share on other sites More sharing options...
phofman Posted May 24, 2017 Author Report Share Posted May 24, 2017 Please, may I ask for your suggestion? I would like to avoid modifying stock ugfx. Thanks a lot in advance. Link to comment Share on other sites More sharing options...
Joel Bodenmann Posted May 24, 2017 Report Share Posted May 24, 2017 As mentioned in the post that you linked that really is a relic from older times. I updated the wiki article now. It's correct that the driver has to use the GMOUSE_VFLG_CAL_EXTREMES flag to enable this feature. But that requires modifying the driver. The idea is that a well written driver would expose that feature as an option to the board file. That's currently not the case for the ADS7843 driver so you'd have to add that yourself. I hope that helps. Don't hesitate to ask if you have any further questions. Link to comment Share on other sites More sharing options...
phofman Posted May 24, 2017 Author Report Share Posted May 24, 2017 Thanks a lot, Joel. Would the GMOUSE_VFLG_CAL_EXTREMES flag go to #if GINPUT_MOUSE_MAX_CALIBRATION_ERROR on line https://git.ugfx.io/Tectu/uGFX/src/master/drivers/ginput/touch/ADS7843/gmouse_lld_ADS7843.c#L52 ? I can send a patch to the driver, if you want to accept it. The reason I asked is I could not find this parameter check in any of the existing drivers and that confused me. Ugfx (+chibios) works great and fast on my ILI9487 8-bit TFT + touch, all the demos. Thanks for the nice project. Link to comment Share on other sites More sharing options...
inmarket Posted May 24, 2017 Report Share Posted May 24, 2017 Yes please. That would be great. Link to comment Share on other sites More sharing options...
phofman Posted May 26, 2017 Author Report Share Posted May 26, 2017 OK, I will do so when I finish prototyping my project in python and get back to rewriting modules for the MCU. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now