diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2014-07-03 16:25:02 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2014-07-03 16:25:02 -0600 |
commit | e64b7e3367eb7356bc7699a6d82c37eb0ec2fade (patch) | |
tree | 0126cfaa285b12bfcb2ca2a5cdc51b011e4b21ee /apps/nshlib/nsh.h | |
parent | e196cbac058b891f899a57e05383e911e848c1b8 (diff) | |
download | px4-nuttx-e64b7e3367eb7356bc7699a6d82c37eb0ec2fade.tar.gz px4-nuttx-e64b7e3367eb7356bc7699a6d82c37eb0ec2fade.tar.bz2 px4-nuttx-e64b7e3367eb7356bc7699a6d82c37eb0ec2fade.zip |
NSH: Add an option to take stdin from a USB keyboard device
Diffstat (limited to 'apps/nshlib/nsh.h')
-rw-r--r-- | apps/nshlib/nsh.h | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/apps/nshlib/nsh.h b/apps/nshlib/nsh.h index 9546155cd..f15eaf5d6 100644 --- a/apps/nshlib/nsh.h +++ b/apps/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 |