diff options
| author | Ha Thach <[email protected]> | 2022-04-20 23:32:50 +0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-04-20 23:32:50 +0700 |
| commit | 55a5fd59d7263289f5c26d52ab206ed571cc1e0c (patch) | |
| tree | 17f0c6d038ea9a73fdc78d94f15e50f2b3233b5c /src/device/usbd.h | |
| parent | 9c8c5c1c53214b8954bb28c33a496b5b423d5ecc (diff) | |
| parent | 87572871d586856242c1fa44b1532a09e624162d (diff) | |
Merge pull request #1440 from hathach/osal-queue-timeout
Osal queue timeout
Diffstat (limited to 'src/device/usbd.h')
| -rw-r--r-- | src/device/usbd.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/device/usbd.h b/src/device/usbd.h index b2bf8ba9d..583962611 100644 --- a/src/device/usbd.h +++ b/src/device/usbd.h @@ -43,8 +43,17 @@ bool tud_init (uint8_t rhport); // Check if device stack is already initialized bool tud_inited(void); +// Task function should be called in main/rtos loop, extended version of tud_task() +// - timeout_ms: millisecond to wait, zero = no wait, 0xFFFFFFFF = wait forever +// - in_isr: if function is called in ISR +void tud_task_ext(uint32_t timeout_ms, bool in_isr); + // Task function should be called in main/rtos loop -void tud_task (void); +TU_ATTR_ALWAYS_INLINE static inline +void tud_task (void) +{ + tud_task_ext(UINT32_MAX, false); +} // Check if there is pending events need proccessing by tud_task() bool tud_task_event_ready(void); |
