mirror of
https://github.com/apache/nuttx-apps.git
synced 2025-10-19 11:23:07 +08:00
NSH: Add an option to take stdin from a USB keyboard device
This commit is contained in:
32
nshlib/nsh.h
32
nshlib/nsh.h
@@ -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
|
||||
|
Reference in New Issue
Block a user