diff options
| author | hathach <[email protected]> | 2013-03-26 12:14:04 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2013-03-26 12:14:04 +0700 |
| commit | 03d045ecde8961ec7ca1579b9d207a0a83d442e3 (patch) | |
| tree | 58cac547725fdf8937c06a8781dfec3cb9143371 /tinyusb/class | |
| parent | 54acee1fc80ce6f3ba86c91db4409e1ebfbda638 (diff) | |
- put ATTR_UNUSED to hardfault handler variables to discard compiler warning
- change host_class_driver_t: open_subtask signature to accept tusb_descriptor_interface_t const * instead of uint8_t*
Diffstat (limited to 'tinyusb/class')
| -rw-r--r-- | tinyusb/class/hid_host.c | 19 | ||||
| -rw-r--r-- | tinyusb/class/hid_host.h | 4 | ||||
| -rw-r--r-- | tinyusb/class/msc_host.h | 6 |
3 files changed, 13 insertions, 16 deletions
diff --git a/tinyusb/class/hid_host.c b/tinyusb/class/hid_host.c index 00ef1848c..c14b497c4 100644 --- a/tinyusb/class/hid_host.c +++ b/tinyusb/class/hid_host.c @@ -40,7 +40,6 @@ #if (MODE_HOST_SUPPORTED && defined HOST_CLASS_HID) #define _TINY_USB_SOURCE_FILE_ - //--------------------------------------------------------------------+ // INCLUDE //--------------------------------------------------------------------+ @@ -80,7 +79,6 @@ void hidh_init(void) #endif } - tusb_error_t hidh_keyboard_open_subtask(uint8_t dev_addr, uint8_t const *descriptor, uint16_t *p_length) { hidh_keyboard_info_t *p_keyboard = get_kbd_data(dev_addr); @@ -110,34 +108,33 @@ tusb_error_t hidh_keyboard_open_subtask(uint8_t dev_addr, uint8_t const *descrip return TUSB_ERROR_NONE; } -tusb_error_t hidh_open_subtask(uint8_t dev_addr, uint8_t const *descriptor, uint16_t *p_length) +tusb_error_t hidh_open_subtask(uint8_t dev_addr, tusb_descriptor_interface_t const *p_interface_desc, uint16_t *p_length) { - tusb_descriptor_interface_t* p_interface = (tusb_descriptor_interface_t*) descriptor; - if (p_interface->bInterfaceSubClass == HID_SUBCLASS_BOOT) + uint8_t const *p_desc = (uint8_t const *) p_interface_desc; + if (p_interface_desc->bInterfaceSubClass == HID_SUBCLASS_BOOT) { - switch(p_interface->bInterfaceProtocol) + switch(p_interface_desc->bInterfaceProtocol) { #if TUSB_CFG_HOST_HID_KEYBOARD case HID_PROTOCOL_KEYBOARD: - - return hidh_keyboard_open_subtask(dev_addr, descriptor, p_length); + return hidh_keyboard_open_subtask(dev_addr, p_desc, p_length); break; #endif #if TUSB_CFG_HOST_HID_MOUSE case HID_PROTOCOL_MOUSE: - return hidh_keyboard_open_subtask(dev_addr, descriptor, p_length); + return hidh_keyboard_open_subtask(dev_addr, p_desc, p_length); break; #endif default: // unknown protocol --> skip this interface - *p_length = p_interface->bLength; + *p_length = p_interface_desc->bLength; return TUSB_ERROR_NONE; } }else { // open generic - *p_length = p_interface->bLength; + *p_length = p_interface_desc->bLength; return TUSB_ERROR_NONE; } } diff --git a/tinyusb/class/hid_host.h b/tinyusb/class/hid_host.h index 87c38b7c7..482c3213d 100644 --- a/tinyusb/class/hid_host.h +++ b/tinyusb/class/hid_host.h @@ -67,7 +67,7 @@ typedef struct { uint16_t report_size; }hidh_keyboard_info_t; -bool tusbh_hid_keyboard_is_supported(uint8_t dev_addr) ATTR_PURE ATTR_WARN_UNUSED_RESULT; +bool tusbh_hid_keyboard_is_supported(uint8_t dev_addr) ATTR_PURE ATTR_WARN_UNUSED_RESULT; tusb_error_t tusbh_hid_keyboard_get_report(uint8_t dev_addr, uint8_t instance_num, tusb_keyboard_report_t * const report) ATTR_WARN_UNUSED_RESULT; pipe_status_t tusbh_hid_keyboard_status(uint8_t dev_addr, uint8_t instance_num) ATTR_WARN_UNUSED_RESULT; @@ -85,7 +85,7 @@ pipe_status_t tusbh_hid_keyboard_status(uint8_t dev_addr, uint8_t instance_num) #ifdef _TINY_USB_SOURCE_FILE_ 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; +tusb_error_t hidh_open_subtask(uint8_t dev_addr, tusb_descriptor_interface_t const *p_interface_desc, 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); diff --git a/tinyusb/class/msc_host.h b/tinyusb/class/msc_host.h index ff41a9e34..5d0a87a65 100644 --- a/tinyusb/class/msc_host.h +++ b/tinyusb/class/msc_host.h @@ -69,9 +69,9 @@ #ifdef _TINY_USB_SOURCE_FILE_ void msch_init(void) ATTR_WEAK; -tusb_error_t msch_open_subtask(uint8_t dev_addr, uint8_t const *descriptor, uint16_t *p_length) ATTR_WEAK ATTR_WARN_UNUSED_RESULT; -void msch_isr(pipe_handle_t pipe_hdl, tusb_bus_event_t event) ATTR_WEAK; -void msch_close(uint8_t dev_addr) ATTR_WEAK; +tusb_error_t msch_open_subtask(uint8_t dev_addr, tusb_descriptor_interface_t const *descriptor, uint16_t *p_length) ATTR_WEAK ATTR_WARN_UNUSED_RESULT; +void msch_isr(pipe_handle_t pipe_hdl, tusb_bus_event_t event) ATTR_WEAK; +void msch_close(uint8_t dev_addr) ATTR_WEAK; #endif #ifdef __cplusplus |
