diff options
| author | hathach <[email protected]> | 2014-03-14 14:33:50 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2014-03-14 14:33:50 +0700 |
| commit | 5f309413dc8634274ffa68d0e5c7d21e49b246b1 (patch) | |
| tree | 793e0117817e14392912b00de9dd52e1cad37f7c /tinyusb/host | |
| parent | 5e2ed2534ebc7576f028e09023bae923965c645e (diff) | |
clean more warnings
Diffstat (limited to 'tinyusb/host')
| -rw-r--r-- | tinyusb/host/hub.c | 24 | ||||
| -rw-r--r-- | tinyusb/host/usbh.c | 11 |
2 files changed, 24 insertions, 11 deletions
diff --git a/tinyusb/host/hub.c b/tinyusb/host/hub.c index 5e6744c21..2a9764bd1 100644 --- a/tinyusb/host/hub.c +++ b/tinyusb/host/hub.c @@ -207,19 +207,29 @@ tusb_error_t hub_open_subtask(uint8_t dev_addr, tusb_descriptor_interface_t cons OSAL_SUBTASK_END
}
+// is the response of interrupt endpoint polling
void hub_isr(pipe_handle_t pipe_hdl, tusb_event_t event, uint32_t xferred_bytes)
{
+ (void) xferred_bytes; // TODO can be more than 1 for hub with lots of ports
+
usbh_hub_t * p_hub = &hub_data[pipe_hdl.dev_addr-1];
- for (uint8_t port=1; port <= p_hub->port_number; port++)
- { // TODO HUB ignore bit0 hub_status_change
- if ( BIT_TEST_(p_hub->status_change, port) )
- {
- usbh_hub_port_plugged_isr(pipe_hdl.dev_addr, port);
+ if ( event == TUSB_EVENT_XFER_COMPLETE )
+ {
+ for (uint8_t port=1; port <= p_hub->port_number; port++)
+ { // TODO HUB ignore bit0 hub_status_change
+ if ( BIT_TEST_(p_hub->status_change, port) )
+ {
+ usbh_hub_port_plugged_isr(pipe_hdl.dev_addr, port);
+ }
}
+ // NOTE: next status transfer is queued by usbh.c after handling this request
+ }
+ else
+ {
+ // TODO [HUB] check if hub is still plugged before polling status endpoint since failed usually mean hub unplugged
+// ASSERT_INT ( TUSB_ERROR_NONE, hcd_pipe_xfer(pipe_hdl, &p_hub->status_change, 1, true) );
}
-
- // NOTE: next status transfer is queued by usbh.c after handling this request
}
void hub_close(uint8_t dev_addr)
diff --git a/tinyusb/host/usbh.c b/tinyusb/host/usbh.c index e6db37d4b..f09207859 100644 --- a/tinyusb/host/usbh.c +++ b/tinyusb/host/usbh.c @@ -240,10 +240,11 @@ static inline tusb_error_t usbh_pipe_control_close(uint8_t dev_addr) return TUSB_ERROR_NONE;
}
-tusb_interface_status_t usbh_pipe_status_get(pipe_handle_t pipe_hdl)
-{
- return TUSB_INTERFACE_STATUS_BUSY;
-}
+// TODO [USBH] unify pipe status get
+//tusb_interface_status_t usbh_pipe_status_get(pipe_handle_t pipe_hdl)
+//{
+// return TUSB_INTERFACE_STATUS_BUSY;
+//}
//--------------------------------------------------------------------+
// USBH-HCD ISR/Callback API
@@ -347,6 +348,8 @@ static tusb_error_t enumeration_body_subtask(void); // forever loop cannot have any return at all.
OSAL_TASK_FUNCTION(usbh_enumeration_task) (void* p_task_para)
{
+ (void) p_task_para; // suppress compiler warnings
+
OSAL_TASK_LOOP_BEGIN
enumeration_body_subtask();
|
