diff options
| author | hathach <[email protected]> | 2013-02-01 14:21:22 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2013-02-01 14:21:22 +0700 |
| commit | a25da9d3eec9e43b051a94dfe0418b0b5bb9c2d9 (patch) | |
| tree | 4ad2a610dd30addc1e66031911180c72eb519f8c /tinyusb/host/usbd_host.c | |
| parent | 7fc3e4f8fed38cd41574976fbfa21f8be43b2eba (diff) | |
house keeping
add some more logic for enum task
Diffstat (limited to 'tinyusb/host/usbd_host.c')
| -rw-r--r-- | tinyusb/host/usbd_host.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/tinyusb/host/usbd_host.c b/tinyusb/host/usbd_host.c index 3e8c05389..657bb28be 100644 --- a/tinyusb/host/usbd_host.c +++ b/tinyusb/host/usbd_host.c @@ -78,11 +78,31 @@ osal_queue_handle_t enum_queue_hdl; void usbh_enumeration_task(void) { + usbh_enumerate_t enum_item; + tusb_error_t error; + OSAL_TASK_LOOP { OSAL_TASK_LOOP_BEGIN -// osal_queue_receive(enumeration_queue_hdl, ) + osal_queue_receive(enum_queue_hdl, (uint32_t*)&enum_item, OSAL_TIMEOUT_NORMAL, &error); + if (error != TUSB_ERROR_NONE) + { + ASSERT_STATEMENT("%s", TUSB_ErrorStr[error]); + } + else + { + if (enum_item.hub_address == 0) // direct connection + { + if ( enum_item.connect_status == hcd_port_connect_status(enum_item.core_id) ) // there chances the event is out-dated + { + + } + }else // device connect via a hub + { + ASSERT_STATEMENT("%s", "Hub is not supported yet"); + } + } OSAL_TASK_LOOP_END } |
