From bbfa85aa08d19f57f6e1c8bb0040839e38d9a01c Mon Sep 17 00:00:00 2001 From: hathach Date: Tue, 24 Sep 2013 18:23:34 +0700 Subject: 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) --- tinyusb/host/usbh.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'tinyusb/host/usbh.c') 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 } -- cgit v1.3.1