diff options
| author | hathach <[email protected]> | 2025-03-26 21:13:01 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2025-03-26 21:32:18 +0700 |
| commit | 901ce2ad93b39c08e8e6b7e5b3f4dbd0b9df879e (patch) | |
| tree | 27959d28ffed7d77d288f5680617bc5c01a707d9 /src/device | |
| parent | 1615120bca3c482b7ba3b2d5620393354acf9c81 (diff) | |
hcd/ehci: hcd_edpt_open() return false if ep is already opened. implement hcd_edpt_close()
Diffstat (limited to 'src/device')
| -rw-r--r-- | src/device/usbd.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/device/usbd.c b/src/device/usbd.c index fb5cec49d..9c381d5e0 100644 --- a/src/device/usbd.c +++ b/src/device/usbd.c @@ -561,8 +561,7 @@ static void usbd_reset(uint8_t rhport) { } bool tud_task_event_ready(void) { - // Skip if stack is not initialized - if (!tud_inited()) return false; + TU_VERIFY(tud_inited()); // Skip if stack is not initialized return !osal_queue_empty(_usbd_q); } @@ -684,7 +683,9 @@ void tud_task_ext(uint32_t timeout_ms, bool in_isr) { case USBD_EVENT_FUNC_CALL: TU_LOG_USBD("\r\n"); - if (event.func_call.func) event.func_call.func(event.func_call.param); + if (event.func_call.func) { + event.func_call.func(event.func_call.param); + } break; case DCD_EVENT_SOF: @@ -701,7 +702,7 @@ void tud_task_ext(uint32_t timeout_ms, bool in_isr) { #if CFG_TUSB_OS != OPT_OS_NONE && CFG_TUSB_OS != OPT_OS_PICO // return if there is no more events, for application to run other background - if (osal_queue_empty(_usbd_q)) return; + if (osal_queue_empty(_usbd_q)) { return; } #endif } } |
