diff options
| author | hathach <[email protected]> | 2013-09-24 18:23:34 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2013-09-24 18:23:34 +0700 |
| commit | bbfa85aa08d19f57f6e1c8bb0040839e38d9a01c (patch) | |
| tree | b79eac25722edca6eca467ae62b2506add73f7d7 /tinyusb/host/usbh.c | |
| parent | 63b776f7cf3bb7fe64c2f3b3e383a90b2c50683f (diff) | |
allow a limited model to deal with stalled pipe/transaction
added stall clear & able to mount the stupid toshiba thumb drive
add HCD pipe API
- bool hcd_pipe_is_busy(pipe_handle_t pipe_hdl);
- bool hcd_pipe_is_stalled(pipe_handle_t pipe_hdl);
- uint8_t hcd_pipe_get_endpoint_addr(pipe_handle_t pipe_hdl);
- tusb_error_t hcd_pipe_clear_stall(pipe_handle_t pipe_hdl);
remove tusbh_device_mount_failed_cb (not neccessary for user)
Diffstat (limited to 'tinyusb/host/usbh.c')
| -rw-r--r-- | tinyusb/host/usbh.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/tinyusb/host/usbh.c b/tinyusb/host/usbh.c index 67cc8f96c..65efe8768 100644 --- a/tinyusb/host/usbh.c +++ b/tinyusb/host/usbh.c @@ -216,9 +216,13 @@ tusb_error_t usbh_control_xfer_subtask(uint8_t dev_addr, uint8_t bmRequestType, osal_mutex_release(usbh_devices[dev_addr].control.mutex_hdl); // TODO make handler for this function general purpose - SUBTASK_ASSERT_WITH_HANDLER(TUSB_ERROR_NONE == error && - TUSB_EVENT_XFER_COMPLETE == usbh_devices[dev_addr].control.pipe_status, - tusbh_device_mount_failed_cb(TUSB_ERROR_USBH_MOUNT_DEVICE_NOT_RESPOND, NULL) ); + if (TUSB_ERROR_NONE != error) SUBTASK_EXIT(error); + if (TUSB_EVENT_XFER_STALLED == usbh_devices[dev_addr].control.pipe_status) SUBTASK_EXIT(TUSB_ERROR_USBH_XFER_STALLED); + if (TUSB_EVENT_XFER_ERROR == usbh_devices[dev_addr].control.pipe_status) SUBTASK_EXIT(TUSB_ERROR_USBH_XFER_FAILED); + +// SUBTASK_ASSERT_WITH_HANDLER(TUSB_ERROR_NONE == error && +// TUSB_EVENT_XFER_COMPLETE == usbh_devices[dev_addr].control.pipe_status, +// tusbh_device_mount_failed_cb(TUSB_ERROR_USBH_MOUNT_DEVICE_NOT_RESPOND, NULL) ); OSAL_SUBTASK_END } |
