summaryrefslogtreecommitdiff
path: root/tinyusb/host
diff options
context:
space:
mode:
authorhathach <[email protected]>2013-06-27 03:20:14 +0700
committerhathach <[email protected]>2013-06-27 03:20:14 +0700
commitc81c4bb817925f385b45c46857b3f0630edb99ed (patch)
treedd5abf6ca10c6f5dd9119ab00c0c3e44d2af2c87 /tinyusb/host
parentea2e63a332a0d46971f32bd84c84851c2246fe8c (diff)
add set idle request for hidh_open_subtask
add interface number to hidh_interface_info_t refractor hidh_open_subtask to be a true subtask cannot run with set idle code ON because of semaphore misuse
Diffstat (limited to 'tinyusb/host')
-rw-r--r--tinyusb/host/usbh.c9
-rw-r--r--tinyusb/host/usbh.h2
2 files changed, 8 insertions, 3 deletions
diff --git a/tinyusb/host/usbh.c b/tinyusb/host/usbh.c
index 62d6b056c..419b1a534 100644
--- a/tinyusb/host/usbh.c
+++ b/tinyusb/host/usbh.c
@@ -176,7 +176,7 @@ tusb_error_t usbh_control_xfer_subtask(uint8_t dev_addr, tusb_std_request_t cons
usbh_devices[dev_addr].control.pipe_status = TUSB_INTERFACE_STATUS_BUSY;
usbh_devices[dev_addr].control.request = *p_request;
- (void) hcd_pipe_control_xfer(dev_addr, &usbh_devices[dev_addr].control.request, data);
+ SUBTASK_ASSERT_STATUS( hcd_pipe_control_xfer(dev_addr, &usbh_devices[dev_addr].control.request, data) );
osal_semaphore_wait(usbh_devices[dev_addr].control.sem_hdl, OSAL_TIMEOUT_NORMAL, &error); // careful of local variable without static
// TODO make handler for this function general purpose
@@ -447,6 +447,9 @@ tusb_error_t enumeration_body_subtask(void)
usbh_devices[new_addr].state = TUSB_DEVICE_STATE_CONFIGURED;
+ //------------- TODO Get String Descriptors -------------//
+
+
//------------- parse configuration & install drivers -------------//
p_desc = enum_data_buffer + sizeof(tusb_descriptor_configuration_t);
@@ -472,12 +475,12 @@ tusb_error_t enumeration_body_subtask(void)
error
);
- if (error == TUSB_ERROR_NONE) // Interface open failed, for example a subclass is not supported
+ if (error == TUSB_ERROR_NONE)
{
SUBTASK_ASSERT( length >= sizeof(tusb_descriptor_interface_t) );
usbh_devices[new_addr].flag_supported_class |= BIT_(class_index);
p_desc += length;
- }else
+ }else // Interface open failed, for example a subclass is not supported
{
p_desc += p_desc[DESCRIPTOR_OFFSET_LENGTH]; // skip this interface, the rest will be skipped by the above loop
}
diff --git a/tinyusb/host/usbh.h b/tinyusb/host/usbh.h
index 5879e7321..97eb4542b 100644
--- a/tinyusb/host/usbh.h
+++ b/tinyusb/host/usbh.h
@@ -111,6 +111,8 @@ void tusbh_device_mount_failed_cb(tusb_error_t error, tusb_descriptor_de
OSAL_TASK_FUNCTION (usbh_enumeration_task) (void* p_task_para);
tusb_error_t usbh_init(void);
+tusb_error_t usbh_control_xfer_subtask(uint8_t dev_addr, tusb_std_request_t const* p_request, uint8_t* data);
+
#endif
#ifdef __cplusplus