summaryrefslogtreecommitdiff
path: root/src/device/usbd.h
diff options
context:
space:
mode:
authorHa Thach <[email protected]>2022-05-21 13:54:25 +0700
committerGitHub <[email protected]>2022-05-21 13:54:25 +0700
commit2683deb0dd2e049de6c9b15f49d28a2fef4380f6 (patch)
treefb480d7a4fa7aa7797097600b6d8a5fef3f080b3 /src/device/usbd.h
parent817227a850d4942cf48ede675325d635e2e7b3d5 (diff)
parentc2bcda86e2de35cc01628f4e909e2a7869a7322b (diff)
Merge branch 'master' into ch32v307
Diffstat (limited to 'src/device/usbd.h')
-rw-r--r--src/device/usbd.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/device/usbd.h b/src/device/usbd.h
index b2bf8ba9d..964cfb992 100644
--- a/src/device/usbd.h
+++ b/src/device/usbd.h
@@ -43,10 +43,19 @@ 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()
+// Check if there is pending events need processing by tud_task()
bool tud_task_event_ready(void);
// Interrupt handler, name alias to DCD