summaryrefslogtreecommitdiff
path: root/src/osal/osal_none.h
diff options
context:
space:
mode:
authorhathach <[email protected]>2026-05-27 19:20:58 +0700
committerhathach <[email protected]>2026-05-27 19:20:58 +0700
commit616acfa7328b1a05ea0370a3628fc6a07f4caf57 (patch)
tree6c4593800a79099a1f13a8c24cc84bd8e95ef380 /src/osal/osal_none.h
parent4a131e1562d8e388bb86592278324ab6bc9f215d (diff)
osal add osal_task_get_current_handle()
Diffstat (limited to 'src/osal/osal_none.h')
-rw-r--r--src/osal/osal_none.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/osal/osal_none.h b/src/osal/osal_none.h
index 7bf6029d6..e174d3518 100644
--- a/src/osal/osal_none.h
+++ b/src/osal/osal_none.h
@@ -34,6 +34,22 @@ extern "C" {
// osal_time_millis() is not provided, tusb_time_millis_api() must be implemented by user application
//--------------------------------------------------------------------+
+// TASK API
+//--------------------------------------------------------------------+
+// Bare-metal single context: return a non-NULL sentinel so equality compares true.
+typedef void* osal_task_handle_t;
+
+TU_ATTR_ALWAYS_INLINE static inline osal_task_handle_t osal_task_get_current_handle(void) {
+ return (osal_task_handle_t) 1;
+}
+
+// Bare-metal has no scheduler to yield to; this is dead code in practice because
+// callers gate it on running outside the host task, which can't happen here.
+TU_ATTR_ALWAYS_INLINE static inline void osal_task_delay(uint32_t msec) {
+ (void) msec;
+}
+
+//--------------------------------------------------------------------+
// Spinlock API
//--------------------------------------------------------------------+
// Note: This implementation is designed for bare-metal single-core systems without RTOS.