diff options
-rw-r--r-- | nuttx/ChangeLog | 5 | ||||
-rw-r--r-- | nuttx/configs/stm32f4discovery/src/stm32_usb.c | 19 | ||||
-rw-r--r-- | nuttx/include/nuttx/usb/usbhost.h | 6 |
3 files changed, 29 insertions, 1 deletions
diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index e9d2f12ba..7426dbf54 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -7192,4 +7192,7 @@ Sourceforge bug 25 submitted by Luciano Neri (2014-4-17). * arch/arm/src/stm32/stm32_otgfshost.c: Some fixes related to low-speed devices and interrupt endpoints from Leo (2014-4-17). - + * configs/stm32f4discovery/src/stm32_usb.c: Add support to register + keyboard and mouse classes if so configured. From Leo (2014-4-17). + * include/nuttx/usb/usbhost: Fix some USB HID-related conditional + compilation. From Leo (2014-4-17). diff --git a/nuttx/configs/stm32f4discovery/src/stm32_usb.c b/nuttx/configs/stm32f4discovery/src/stm32_usb.c index 071d096e6..fbc77fdd5 100644 --- a/nuttx/configs/stm32f4discovery/src/stm32_usb.c +++ b/nuttx/configs/stm32f4discovery/src/stm32_usb.c @@ -177,11 +177,30 @@ int stm32_usbhost_initialize(void) */ uvdbg("Register class drivers\n"); + +#ifdef CONFIG_USBHOST_MSC ret = usbhost_storageinit(); if (ret != OK) { udbg("Failed to register the mass storage class\n"); } +#endif + +#ifdef CONFIG_USBHOST_HIDKBD + ret = usbhost_kbdinit(); + if (ret != OK) + { + udbg("Failed to register the HID keyboard class\n"); + } +#endif + +#ifdef CONFIG_USBHOST_HIDMOUSE + ret = usbhost_mouse_init(); + if (ret != OK) + { + udbg("Failed to register the HID mouse class\n"); + } +#endif /* Then get an instance of the USB host interface */ diff --git a/nuttx/include/nuttx/usb/usbhost.h b/nuttx/include/nuttx/usb/usbhost.h index 91335d7a6..8c4b67828 100644 --- a/nuttx/include/nuttx/usb/usbhost.h +++ b/nuttx/include/nuttx/usb/usbhost.h @@ -798,6 +798,7 @@ int usbhost_registerclass(struct usbhost_registry_s *class); const struct usbhost_registry_s *usbhost_findclass(const struct usbhost_id_s *id); +#ifdef CONFIG_USBHOST_MSC /**************************************************************************** * Name: usbhost_storageinit * @@ -816,7 +817,9 @@ const struct usbhost_registry_s *usbhost_findclass(const struct usbhost_id_s *id ****************************************************************************/ int usbhost_storageinit(void); +#endif +#ifdef CONFIG_USBHOST_HIDKBD /**************************************************************************** * Name: usbhost_kbdinit * @@ -835,7 +838,9 @@ int usbhost_storageinit(void); ****************************************************************************/ int usbhost_kbdinit(void); +#endif +#ifdef CONFIG_USBHOST_HIDMOUSE /**************************************************************************** * Name: usbhost_mouse_init * @@ -854,6 +859,7 @@ int usbhost_kbdinit(void); ****************************************************************************/ int usbhost_mouse_init(void); +#endif /**************************************************************************** * Name: usbhost_wlaninit |