diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2013-10-30 11:21:25 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2013-10-30 11:21:25 -0600 |
commit | 9c190bae9b5d3082d156626dc7c741691a3338cd (patch) | |
tree | 126bf12b5c653ea99b85995f93cd777dab7b6910 /NxWidgets/nxwm/src | |
parent | 126a5c275c84910761067dee75f1e4dbaf05bb9a (diff) | |
download | nuttx-9c190bae9b5d3082d156626dc7c741691a3338cd.tar.gz nuttx-9c190bae9b5d3082d156626dc7c741691a3338cd.tar.bz2 nuttx-9c190bae9b5d3082d156626dc7c741691a3338cd.zip |
Saving of touchscreen calibration but be done in CCalbration each time the touchscreen is calibrated, not just once on startup
Diffstat (limited to 'NxWidgets/nxwm/src')
-rw-r--r-- | NxWidgets/nxwm/src/ccalibration.cxx | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/NxWidgets/nxwm/src/ccalibration.cxx b/NxWidgets/nxwm/src/ccalibration.cxx index c7910f557..562ef206e 100644 --- a/NxWidgets/nxwm/src/ccalibration.cxx +++ b/NxWidgets/nxwm/src/ccalibration.cxx @@ -45,6 +45,10 @@ #include <assert.h> #include <debug.h> +#ifdef CONFIG_NXWM_TOUCHCREEN_CONFIGDATA +# include <arch/platform/configdata.h> +#endif + #include "nxwmconfig.hxx" #include "nxwmglyphs.hxx" #include "ctouchscreen.hxx" @@ -1099,7 +1103,20 @@ void CCalibration::finishCalibration(void) struct SCalibrationData caldata; if (createCalibrationData(caldata)) { - // And provide this to the touchscreen, enabling touchscreen processing +#ifdef CONFIG_NXWM_TOUCHCREEN_CONFIGDATA + // Save the new calibration data. The saved calibration + // data may be used to avoided recalibrating in the future. + + int ret = platform_setconfig(CONFIGDATA_TSCALIBRATION, 0, + (FAR const uint8_t *)&caldata, + sizeof(struct SCalibrationData)); + if (ret != 0) + { + gdbg("ERROR: Failed to save calibration data\n"); + } +#endif + // And provide the calibration data to the touchscreen, enabling + // touchscreen processing m_touchscreen->setEnabled(false); m_touchscreen->setCalibrationData(caldata); |