remove obsolete TUSB_CFG_HOST_HID_KEYBOARD_ENDPOINT_SIZE

temporarily ignore test for hid_host.c due to ceedling linking issue with weak symbol
implement hidh_open_subtask driver to subclass open
rename hidh_keyboard_install to hidh_keyboard_open_subtask
This commit is contained in:
hathach
2013-03-25 16:02:24 +07:00
parent 45db7b4a53
commit c026a9f2e0
9 changed files with 65 additions and 27 deletions

View File

@@ -75,7 +75,33 @@ void hidh_init(void)
tusb_error_t hidh_open_subtask(uint8_t dev_addr, uint8_t const *descriptor, uint16_t *p_length)
{
return TUSB_ERROR_NONE;
tusb_descriptor_interface_t* p_interface = (tusb_descriptor_interface_t*) descriptor;
if (p_interface->bInterfaceSubClass == HID_SUBCLASS_BOOT)
{
switch(p_interface->bInterfaceProtocol)
{
#if TUSB_CFG_HOST_HID_KEYBOARD
case HID_PROTOCOL_KEYBOARD:
return hidh_keyboard_open_subtask(dev_addr, descriptor, p_length);
break;
#endif
#if TUSB_CFG_HOST_HID_MOUSE
case HID_PROTOCOL_MOUSE:
return hidh_keyboard_open_subtask(dev_addr, descriptor, p_length);
break;
#endif
default: // unknown protocol --> skip this interface
*p_length = p_interface->bLength;
return TUSB_ERROR_NONE;
}
}else
{
// open generic
*p_length = p_interface->bLength;
return TUSB_ERROR_NONE;
}
}
void hidh_isr(pipe_handle_t pipe_hdl, tusb_bus_event_t event)