mirror of
https://github.com/apache/nuttx.git
synced 2026-05-20 04:16:35 +08:00
Add logic to register HID keybaord and mouse classes; fix some conditional compilation. From Leo
This commit is contained in:
@@ -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).
|
||||
|
||||
@@ -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 */
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user