add flag_supported_class to usbh_devices

remove all ATTR_WEAK in init,open,isr,close driver functions of USBH-CLASS API
- prefer testing
This commit is contained in:
hathach
2013-03-26 02:02:54 +07:00
parent ff03b452d9
commit 086a8e4a2d
8 changed files with 66 additions and 23 deletions

View File

@@ -111,7 +111,17 @@ void hidh_isr(pipe_handle_t pipe_hdl, tusb_bus_event_t event)
void hidh_close(uint8_t dev_addr)
{
#if TUSB_CFG_HOST_HID_KEYBOARD
hidh_keyboard_close(dev_addr);
#endif
#if TUSB_CFG_HOST_HID_MOUSE
hidh_mouse_close(dev_addr);
#endif
#if TUSB_CFG_HOST_HID_GENERIC
hidh_generic_close(dev_addr);
#endif
}
#endif

View File

@@ -72,14 +72,14 @@
//--------------------------------------------------------------------+
//--------------------------------------------------------------------+
// CLASS DRIVER FUNCTION (all declared with WEAK)
// CLASS DRIVER FUNCTION
//--------------------------------------------------------------------+
#ifdef _TINY_USB_SOURCE_FILE_
void hidh_init(void) ATTR_WEAK;
tusb_error_t hidh_open_subtask(uint8_t dev_addr, uint8_t const *descriptor, uint16_t *p_length) ATTR_WEAK ATTR_WARN_UNUSED_RESULT;
void hidh_isr(pipe_handle_t pipe_hdl, tusb_bus_event_t event) ATTR_WEAK;
void hidh_close(uint8_t dev_addr) ATTR_WEAK;
void hidh_init(void);
tusb_error_t hidh_open_subtask(uint8_t dev_addr, uint8_t const *descriptor, uint16_t *p_length) ATTR_WARN_UNUSED_RESULT;
void hidh_isr(pipe_handle_t pipe_hdl, tusb_bus_event_t event);
void hidh_close(uint8_t dev_addr);
#endif