summaryrefslogtreecommitdiff
path: root/NxWidgets/nxwm
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-07-17 15:06:05 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-07-17 15:06:05 -0600
commit1504e95a7d8e8182ace6189c5d173da2a306d601 (patch)
treeeac3137fe50c379a412dadd7de32d4dc9deeedc6 /NxWidgets/nxwm
parent2e16493c175195a52d6a14828e3c2ea468bc793a (diff)
downloadnuttx-1504e95a7d8e8182ace6189c5d173da2a306d601.tar.gz
nuttx-1504e95a7d8e8182ace6189c5d173da2a306d601.tar.bz2
nuttx-1504e95a7d8e8182ace6189c5d173da2a306d601.zip
NxWM: Increase default priority of mouse and keyboard listener threads. Does not seem to make any difference but still seems like a good idea
Diffstat (limited to 'NxWidgets/nxwm')
-rw-r--r--NxWidgets/nxwm/include/nxwmconfig.hxx12
-rw-r--r--NxWidgets/nxwm/src/ctouchscreen.cxx10
2 files changed, 14 insertions, 8 deletions
diff --git a/NxWidgets/nxwm/include/nxwmconfig.hxx b/NxWidgets/nxwm/include/nxwmconfig.hxx
index 4160fbae7..75f860c9d 100644
--- a/NxWidgets/nxwm/include/nxwmconfig.hxx
+++ b/NxWidgets/nxwm/include/nxwmconfig.hxx
@@ -429,7 +429,7 @@
* CONFIG_NXWM_TOUCHSCREEN_SIGNO - The realtime signal used to wake up the
* touchscreen listener thread. Default: 5
* CONFIG_NXWM_TOUCHSCREEN_LISTENERPRIO - Priority of the touchscreen listener
- * thread. Default: SCHED_PRIORITY_DEFAULT
+ * thread. Default: (SCHED_PRIORITY_DEFAULT + 20)
* CONFIG_NXWM_TOUCHSCREEN_LISTENERSTACK - Touchscreen listener thread stack
* size. Default 1024
*/
@@ -447,7 +447,11 @@
#endif
#ifndef CONFIG_NXWM_TOUCHSCREEN_LISTENERPRIO
-# define CONFIG_NXWM_TOUCHSCREEN_LISTENERPRIO SCHED_PRIORITY_DEFAULT
+# define CONFIG_NXWM_TOUCHSCREEN_LISTENERPRIO (SCHED_PRIORITY_DEFAULT + 20)
+#endif
+
+#if CONFIG_NXWM_TOUCHSCREEN_LISTENERPRIO <= CONFIG_NXWM_CALIBRATION_LISTENERPRIO
+# warning You should have CONFIG_NXWM_TOUCHSCREEN_LISTENERPRIO > CONFIG_NXWM_CALIBRATION_LISTENERPRIO
#endif
#ifndef CONFIG_NXWM_TOUCHSCREEN_LISTENERSTACK
@@ -465,7 +469,7 @@
* CONFIG_NXWM_KEYBOARD_BUFSIZE - The size of the keyboard read data buffer.
* Default: 16
* CONFIG_NXWM_KEYBOARD_LISTENERPRIO - Priority of the touchscreen listener
- * thread. Default: SCHED_PRIORITY_DEFAULT
+ * thread. Default: (SCHED_PRIORITY_DEFAULT + 20)
* CONFIG_NXWM_KEYBOARD_LISTENERSTACK - Keyboard listener thread stack
* size. Default 1024
*/
@@ -483,7 +487,7 @@
#endif
#ifndef CONFIG_NXWM_KEYBOARD_LISTENERPRIO
-# define CONFIG_NXWM_KEYBOARD_LISTENERPRIO SCHED_PRIORITY_DEFAULT
+# define CONFIG_NXWM_KEYBOARD_LISTENERPRIO (SCHED_PRIORITY_DEFAULT + 20)
#endif
#ifndef CONFIG_NXWM_KEYBOARD_LISTENERSTACK
diff --git a/NxWidgets/nxwm/src/ctouchscreen.cxx b/NxWidgets/nxwm/src/ctouchscreen.cxx
index 68fec4e5b..545405b81 100644
--- a/NxWidgets/nxwm/src/ctouchscreen.cxx
+++ b/NxWidgets/nxwm/src/ctouchscreen.cxx
@@ -363,10 +363,12 @@ FAR void *CTouchscreen::listener(FAR void *arg)
#endif
}
- // On a truly success read, the size of the returned data will
- // be exactly the size of one touchscreen sample
+ // On a truly successful read, the size of the returned data will
+ // be greater than or equal to size of one touchscreen sample. It
+ // be greater only in the case of a multi-touch touchscreen device
+ // when multi-touches are reported.
- else if (nbytes == sizeof(struct touch_sample_s))
+ else if (nbytes >= (ssize_t)sizeof(struct touch_sample_s))
{
// Looks like good touchscreen input... process it
@@ -375,7 +377,7 @@ FAR void *CTouchscreen::listener(FAR void *arg)
else
{
dbg("ERROR Unexpected read size=%d, expected=%d\n",
- nbytes, sizeof(struct touch_sample_s));
+ nbytes, sizeof(struct touch_sample_s));
}
}