diff options
| author | HiFiPhile <[email protected]> | 2025-05-15 21:35:19 +0200 |
|---|---|---|
| committer | HiFiPhile <[email protected]> | 2025-05-15 21:35:19 +0200 |
| commit | 98da642627200c89b5fd8ce0624ed494a1c1e98d (patch) | |
| tree | 228ce580e3f34ae749b6542f360ab6f9442ed089 /src/device | |
| parent | 376c1063b7184984ae44ff5a3d225130bc470d14 (diff) | |
| parent | 1a783b357343d053eb861ae783922371ce9e1b17 (diff) | |
Merge branch 'master' into xfer_close
Signed-off-by: HiFiPhile <[email protected]>
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 } } |
