summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authortfx2001 <[email protected]>2021-02-07 22:44:49 +0800
committertfx2001 <[email protected]>2021-02-08 20:46:49 +0800
commit1b678eccf55a808cde2e9fa450b76fe5e95539ba (patch)
treefa85a884f0305193c0f8207528e597b1d06bc1d6 /hw
parentf49d47a0aa6781e8c4f86fbb7725c23f6549b14e (diff)
add basic support for rt-thread
Diffstat (limited to 'hw')
-rw-r--r--hw/bsp/board.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/hw/bsp/board.h b/hw/bsp/board.h
index 97c80e7c7..7b77def50 100644
--- a/hw/bsp/board.h
+++ b/hw/bsp/board.h
@@ -86,6 +86,11 @@ static inline uint32_t board_millis(void)
{
return to_ms_since_boot(get_absolute_time());
}
+#elif CFG_TUSB_OS == OPT_OS_RTTHREAD
+ static inline uint32_t board_millis(void)
+ {
+ return (((uint64_t)rt_tick_get()) * 1000 / RT_TICK_PER_SECOND);
+ }
#else
#error "board_millis() is not implemented for this OS"