summaryrefslogtreecommitdiff
path: root/src/device
diff options
context:
space:
mode:
authorHa Thach <[email protected]>2025-03-27 10:47:10 +0700
committerGitHub <[email protected]>2025-03-27 10:47:10 +0700
commit8c1802e41d37c915334a19b859b24cb2a1b48ee5 (patch)
treed159c6f13f7c4815622b83fb736377d1c090e4d9 /src/device
parentcf76af1056e9a3019d9b08503b783a86602374f0 (diff)
parent5531de4f2c7e725b95f23083aad7d68d0d95b586 (diff)
Merge pull request #3043 from hathach/hcd-close-ep
feat(host) add endpoint close API and feat(HIL) improvement
Diffstat (limited to 'src/device')
-rw-r--r--src/device/usbd.c9
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
}
}