add basic support for rt-thread

This commit is contained in:
tfx2001
2021-02-07 22:44:49 +08:00
parent f49d47a0aa
commit 1b678eccf5
4 changed files with 138 additions and 0 deletions

View File

@@ -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"