NSH: Add an option to take stdin from a USB keyboard device

This commit is contained in:
Gregory Nutt
2014-07-03 16:25:02 -06:00
parent 5535a8a306
commit 9a49735c4b
8 changed files with 452 additions and 88 deletions

View File

@@ -146,20 +146,46 @@
#ifdef HAVE_USB_CONSOLE
/* The default USB console device minor number is 0*/
/* The default USB console device minor number is 0 */
# ifndef CONFIG_NSH_USBDEV_MINOR
# define CONFIG_NSH_USBDEV_MINOR 0
# endif
/* The default console device is always /dev/console */
/* The default USB serial console device */
# ifndef CONFIG_NSH_USBCONDEV
# define CONFIG_NSH_USBCONDEV "/dev/console"
# if defined(CONFIG_CDCACM)
# define CONFIG_NSH_USBCONDEV "/dev/ttyACM0"
# elif defined(CONFIG_PL2303)
# define CONFIG_NSH_USBCONDEV "/dev/ttyUSB0"
# else
# define CONFIG_NSH_USBCONDEV "/dev/console"
# endif
# endif
#endif /* HAVE_USB_CONSOLE */
/* If a USB keyboard device is selected for NSH input then we need to handle
* some special start-up conditions.
*/
#undef HAVE_USB_KEYBOARD
#if defined(CONFIG_USBHOST) && !defined(HAVE_USB_CONSOLE)
/* Check for a USB HID keyboard in the configuration */
# ifdef CONFIG_USBHOST_HIDKBD
# define HAVE_USB_KEYBOARD 1
/* The default keyboard device is /dev/kbda */
# ifndef NSH_USBKBD_DEVNAME
# define NSH_USBKBD_DEVNAME "/dev/kbda"
# endif
# endif
#endif /* HAVE_USB_KEYBOARD */
/* USB trace settings */
#ifndef CONFIG_USBDEV_TRACE