diff options
| author | hathach <[email protected]> | 2026-02-27 23:34:48 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2026-02-27 23:42:40 +0700 |
| commit | 7ea02fd6c9e376679bc1fe025bb73e43664e17c6 (patch) | |
| tree | 8ff5476245cfb8fe7d885512a4ec03c05167dfa9 /src/osal/osal_rtthread.h | |
| parent | 8302adfab8727896c4a10935a15c32fbdcba3b8e (diff) | |
add osal_time_millis() to osal requirement
implement tusb_time_millis_api() with osal_time_millis() when OS is not NONE
Diffstat (limited to 'src/osal/osal_rtthread.h')
| -rw-r--r-- | src/osal/osal_rtthread.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/osal/osal_rtthread.h b/src/osal/osal_rtthread.h index a778f5425..f560281c5 100644 --- a/src/osal/osal_rtthread.h +++ b/src/osal/osal_rtthread.h @@ -42,6 +42,10 @@ TU_ATTR_ALWAYS_INLINE static inline void osal_task_delay(uint32_t msec) { rt_thread_mdelay(msec); } +TU_ATTR_ALWAYS_INLINE static inline uint32_t osal_time_millis(void) { + return (uint32_t)((((uint64_t)rt_tick_get()) * 1000) / RT_TICK_PER_SECOND); +} + //--------------------------------------------------------------------+ // Spinlock API //--------------------------------------------------------------------+ |
