summaryrefslogtreecommitdiff
path: root/src/device/usbd.h
diff options
context:
space:
mode:
authorHa Thach <[email protected]>2022-11-04 15:42:50 +0700
committerGitHub <[email protected]>2022-11-04 15:42:50 +0700
commitb554c2ed836527296dd0b79169db04fc2f68cf5a (patch)
tree34b25122fac701370b5883b7a878b6a7d92fd76f /src/device/usbd.h
parent35668fc523c7c972bf91f32dbb3b50ad8b4f3c74 (diff)
parent28f49c088bb0c498d730d80943017172061cfd05 (diff)
Merge branch 'master' into rp2040-hcd-bulk
Diffstat (limited to 'src/device/usbd.h')
-rw-r--r--src/device/usbd.h18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/device/usbd.h b/src/device/usbd.h
index b2bf8ba9d..17b4d927b 100644
--- a/src/device/usbd.h
+++ b/src/device/usbd.h
@@ -43,14 +43,26 @@ 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
+#ifndef _TUSB_DCD_H_
extern void dcd_int_handler(uint8_t rhport);
+#endif
+
+// Interrupt handler, name alias to DCD
#define tud_int_handler dcd_int_handler
// Get current bus speed