diff options
| author | hathach <[email protected]> | 2022-04-21 12:05:22 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2022-04-21 12:05:22 +0700 |
| commit | 98bbb0d40251a4fb6af8e20506c5b27a18e8d29e (patch) | |
| tree | d874d9126c1377cec120ba13cd6026ce42475e05 /src/host/usbh.c | |
| parent | 328039058ef1c654246304a3a0acbee724278b85 (diff) | |
| parent | 55a5fd59d7263289f5c26d52ab206ed571cc1e0c (diff) | |
Merge branch 'master' into pio-host
Diffstat (limited to 'src/host/usbh.c')
| -rw-r--r-- | src/host/usbh.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/host/usbh.c b/src/host/usbh.c index 47c462012..4df60626a 100644 --- a/src/host/usbh.c +++ b/src/host/usbh.c @@ -392,8 +392,10 @@ bool tuh_init(uint8_t rhport) } @endcode */ -void tuh_task(void) +void tuh_task_ext(uint32_t timeout_ms, bool in_isr) { + (void) in_isr; // not implemented yet + // Skip if stack is not initialized if ( !tusb_inited() ) return; @@ -401,7 +403,7 @@ void tuh_task(void) while (1) { hcd_event_t event; - if ( !osal_queue_receive(_usbh_q, &event) ) return; + if ( !osal_queue_receive(_usbh_q, &event, timeout_ms) ) return; switch (event.event_id) { @@ -497,6 +499,11 @@ void tuh_task(void) default: break; } + +#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(_usbh_q)) return; +#endif } } |
