summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NxWidgets/Kconfig13
-rw-r--r--NxWidgets/libnxwidgets/include/nxconfig.hxx4
-rw-r--r--NxWidgets/nxwm/include/nxwmconfig.hxx12
-rw-r--r--NxWidgets/nxwm/src/ctouchscreen.cxx10
-rw-r--r--apps/NxWidgets/Kconfig13
-rw-r--r--nuttx/configs/sama5d3x-ek/nxwm/defconfig4
-rw-r--r--nuttx/configs/sama5d4-ek/nxwm/defconfig4
7 files changed, 38 insertions, 22 deletions
diff --git a/NxWidgets/Kconfig b/NxWidgets/Kconfig
index ec56d09a2..37fdccabe 100644
--- a/NxWidgets/Kconfig
+++ b/NxWidgets/Kconfig
@@ -814,9 +814,11 @@ config NXWM_TOUCHSCREEN_SIGNO
config NXWM_TOUCHSCREEN_LISTENERPRIO
int "Touchscreen Listener Task Priority"
- default 100
+ default 120
---help---
- Priority of the touchscreen listener thread. Default: 100
+ Priority of the touchscreen listener thread. This listener should
+ have a higher priority than most display-related tsks otherwise it
+ may miss touchscreen events. Default: 120
config NXWM_TOUCHSCREEN_LISTENERSTACK
int "Touchscreen Listener Task Stack Size"
@@ -870,9 +872,12 @@ config NXWM_KEYBOARD_BUFSIZE
config NXWM_KEYBOARD_LISTENERPRIO
int "Keyboard Listener Task Priority"
- default 100
+ default 120
---help---
- Priority of the touchscreen listener thread. Default: 100
+ Priority of the touchscreen listener thread.This listener should
+ have a higher priority than most display-related tsks otherwise it
+ may miss touchscreen events (not really very likely because keyboard
+ input is relatively slow). Default: 120
config NXWM_KEYBOARD_LISTENERSTACK
int "Keyboard Listener Task Stack Size"
diff --git a/NxWidgets/libnxwidgets/include/nxconfig.hxx b/NxWidgets/libnxwidgets/include/nxconfig.hxx
index 34be7a788..9face1e70 100644
--- a/NxWidgets/libnxwidgets/include/nxconfig.hxx
+++ b/NxWidgets/libnxwidgets/include/nxconfig.hxx
@@ -68,7 +68,7 @@
* CONFIG_NXWIDGETS_VPLANE - Only a single video plane is supported. Default: 0
* CONFIG_NXWIDGETS_SERVERPRIO - Priority of the NX server. This applies
* only if NX is configured in multi-user mode (CONFIG_NX_MULTIUSER=y).
- * Default: SCHED_PRIORITY_DEFAULT+1. NOTE: Of the three priority
+ * Default: (SCHED_PRIORITY_DEFAULT+10). NOTE: Of the three priority
* definitions here, CONFIG_NXWIDGETS_SERVERPRIO should have the highest
* priority to avoid data overrun race conditions. Such errors would most
* likely appear as duplicated rows of data on the display.
@@ -214,7 +214,7 @@
*/
#ifndef CONFIG_NXWIDGETS_SERVERPRIO
-# define CONFIG_NXWIDGETS_SERVERPRIO (SCHED_PRIORITY_DEFAULT+1)
+# define CONFIG_NXWIDGETS_SERVERPRIO (SCHED_PRIORITY_DEFAULT+10)
#endif
#ifndef CONFIG_NXWIDGETS_CLIENTPRIO
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));
}
}
diff --git a/apps/NxWidgets/Kconfig b/apps/NxWidgets/Kconfig
index ec56d09a2..37fdccabe 100644
--- a/apps/NxWidgets/Kconfig
+++ b/apps/NxWidgets/Kconfig
@@ -814,9 +814,11 @@ config NXWM_TOUCHSCREEN_SIGNO
config NXWM_TOUCHSCREEN_LISTENERPRIO
int "Touchscreen Listener Task Priority"
- default 100
+ default 120
---help---
- Priority of the touchscreen listener thread. Default: 100
+ Priority of the touchscreen listener thread. This listener should
+ have a higher priority than most display-related tsks otherwise it
+ may miss touchscreen events. Default: 120
config NXWM_TOUCHSCREEN_LISTENERSTACK
int "Touchscreen Listener Task Stack Size"
@@ -870,9 +872,12 @@ config NXWM_KEYBOARD_BUFSIZE
config NXWM_KEYBOARD_LISTENERPRIO
int "Keyboard Listener Task Priority"
- default 100
+ default 120
---help---
- Priority of the touchscreen listener thread. Default: 100
+ Priority of the touchscreen listener thread.This listener should
+ have a higher priority than most display-related tsks otherwise it
+ may miss touchscreen events (not really very likely because keyboard
+ input is relatively slow). Default: 120
config NXWM_KEYBOARD_LISTENERSTACK
int "Keyboard Listener Task Stack Size"
diff --git a/nuttx/configs/sama5d3x-ek/nxwm/defconfig b/nuttx/configs/sama5d3x-ek/nxwm/defconfig
index 80fe5e08f..34532cf0b 100644
--- a/nuttx/configs/sama5d3x-ek/nxwm/defconfig
+++ b/nuttx/configs/sama5d3x-ek/nxwm/defconfig
@@ -1090,7 +1090,7 @@ CONFIG_NXWM_TOUCHSCREEN_DEVINIT=y
CONFIG_NXWM_TOUCHSCREEN_DEVNO=0
CONFIG_NXWM_TOUCHSCREEN_DEVPATH="/dev/input0"
CONFIG_NXWM_TOUCHSCREEN_SIGNO=5
-CONFIG_NXWM_TOUCHSCREEN_LISTENERPRIO=100
+CONFIG_NXWM_TOUCHSCREEN_LISTENERPRIO=120
CONFIG_NXWM_TOUCHSCREEN_LISTENERSTACK=1596
#
@@ -1104,7 +1104,7 @@ CONFIG_NXWM_KEYBOARD=y
CONFIG_NXWM_KEYBOARD_DEVPATH="/dev/console"
CONFIG_NXWM_KEYBOARD_SIGNO=6
CONFIG_NXWM_KEYBOARD_BUFSIZE=16
-CONFIG_NXWM_KEYBOARD_LISTENERPRIO=100
+CONFIG_NXWM_KEYBOARD_LISTENERPRIO=120
CONFIG_NXWM_KEYBOARD_LISTENERSTACK=1024
#
diff --git a/nuttx/configs/sama5d4-ek/nxwm/defconfig b/nuttx/configs/sama5d4-ek/nxwm/defconfig
index d69c151a3..b643f2f0c 100644
--- a/nuttx/configs/sama5d4-ek/nxwm/defconfig
+++ b/nuttx/configs/sama5d4-ek/nxwm/defconfig
@@ -1361,7 +1361,7 @@ CONFIG_NXWM_TOUCHSCREEN_DEVINIT=y
CONFIG_NXWM_TOUCHSCREEN_DEVNO=0
CONFIG_NXWM_TOUCHSCREEN_DEVPATH="/dev/input0"
CONFIG_NXWM_TOUCHSCREEN_SIGNO=5
-CONFIG_NXWM_TOUCHSCREEN_LISTENERPRIO=100
+CONFIG_NXWM_TOUCHSCREEN_LISTENERPRIO=120
CONFIG_NXWM_TOUCHSCREEN_LISTENERSTACK=1596
#
@@ -1375,7 +1375,7 @@ CONFIG_NXWM_KEYBOARD=y
CONFIG_NXWM_KEYBOARD_DEVPATH="/dev/console"
CONFIG_NXWM_KEYBOARD_SIGNO=6
CONFIG_NXWM_KEYBOARD_BUFSIZE=16
-CONFIG_NXWM_KEYBOARD_LISTENERPRIO=100
+CONFIG_NXWM_KEYBOARD_LISTENERPRIO=120
CONFIG_NXWM_KEYBOARD_LISTENERSTACK=1024
#