From 6671be97cc3669e135cd01bb276bba4f337d4938 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 30 Jul 2014 17:01:51 -0600 Subject: [PATCH] dd support for a USB keyboard as the NxConsole and text widget input. Not fully functional as of this initial check-in. Basic functionality is there, but there are conditions were the keyboard gets lost. --- NxWidgets/Kconfig | 23 +++++++++++++++++------ nshlib/nsh_usbkeyboard.c | 2 +- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/NxWidgets/Kconfig b/NxWidgets/Kconfig index 52aa90da1..3ee3bd123 100644 --- a/NxWidgets/Kconfig +++ b/NxWidgets/Kconfig @@ -855,13 +855,24 @@ config NXWM_KEYBOARD_DEVPATH string "Keyboard Device Path" default "/dev/console" ---help--- - The full path to the touchscreen device. Default: "/dev/console" + The full path to the keyboard device. Default: "/dev/console" + +config NXWM_KEYBOARD_USBHOST + bool "USB Keyboard Device" + default n + ---help--- + This setting indicates that NXWM_KEYBOARD_DEVPATH is a USB keyboard. + A USB Keyboard is a removable device. When it is inserted, then + device at NXWM_KEYBOARD_DEVPATH will appear; when it removed, + keyboard reads will fail and the device at NXWM_KEYBOARD_DEVPATH + will disappear. Selecting this option builds addtional logic into + the keyboard listener thread in order to handle this case. config NXWM_KEYBOARD_SIGNO int "Keyboard Task Signal Number" default 6 ---help--- - The realtime signal used to wake up the touchscreen listener thread. + The realtime signal used to wake up the keyboard listener thread. Default: 6 config NXWM_KEYBOARD_BUFSIZE @@ -874,10 +885,10 @@ config NXWM_KEYBOARD_LISTENERPRIO int "Keyboard Listener Task Priority" default 120 ---help--- - 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 + Priority of the keyboard listener thread. This listener should + have a higher priority than most display-related tasks otherwise it + may miss keyboard input (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/nshlib/nsh_usbkeyboard.c b/nshlib/nsh_usbkeyboard.c index 9baf78955..91aeaaa9a 100644 --- a/nshlib/nsh_usbkeyboard.c +++ b/nshlib/nsh_usbkeyboard.c @@ -116,7 +116,7 @@ static int nsh_wait_usbready(FAR const char *msg) /* ENOENT means that the USB device is not yet connected and, * hence, has no entry under /dev. If the USB driver still - * exists under(because other threads still have the driver + * exists under /dev (because other threads still have the driver * open), then we might also get ENODEV. Anything else would * be really bad. */