summaryrefslogtreecommitdiff
path: root/NxWidgets/nxwm/include/ccalibration.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'NxWidgets/nxwm/include/ccalibration.hxx')
-rw-r--r--NxWidgets/nxwm/include/ccalibration.hxx31
1 files changed, 31 insertions, 0 deletions
diff --git a/NxWidgets/nxwm/include/ccalibration.hxx b/NxWidgets/nxwm/include/ccalibration.hxx
index 376462ca8..30a48f7eb 100644
--- a/NxWidgets/nxwm/include/ccalibration.hxx
+++ b/NxWidgets/nxwm/include/ccalibration.hxx
@@ -160,6 +160,10 @@ namespace NxWM
bool m_stop; /**< True: We have been asked to stop the calibration */
bool m_touched; /**< True: The screen is touched */
uint8_t m_touchId; /**< The ID of the touch */
+#if CONFIG_NXWM_CALIBRATION_AVERAGE
+ uint8_t m_nsamples; /**< Number of samples collected so far at this position */
+ struct nxgl_point_s m_sampleData[CONFIG_NXWM_CALIBRATION_NSAMPLES];
+#endif
struct nxgl_point_s m_calibData[CALIB_DATA_POINTS];
/**
@@ -170,6 +174,22 @@ namespace NxWM
void touchscreenInput(struct touch_sample_s &sample);
+#ifdef CONFIG_NXWM_CALIBRATION_MESSAGES
+ /**
+ * Create widgets need by the calibration thread.
+ *
+ * @return True if the widgets were successfully created.
+ */
+
+ bool createWidgets(void);
+
+ /**
+ * Destroy widgets created for the calibration thread.
+ */
+
+ void destroyWidgets(void);
+#endif
+
/**
* Start the calibration thread.
*
@@ -230,6 +250,17 @@ namespace NxWM
static FAR void *calibration(FAR void *arg);
/**
+ * Accumulate and average touch sample data
+ *
+ * @param average. When the averaged data is available, return it here
+ * @return True: Average data is available; False: Need to collect more samples
+ */
+
+#if CONFIG_NXWM_CALIBRATION_AVERAGE
+ bool averageSamples(struct nxgl_point_s &average);
+#endif
+
+ /**
* This is the calibration state machine. It is called initially and then
* as new touchscreen data is received.
*/