summaryrefslogtreecommitdiff
path: root/hw/bsp/board_api.h
diff options
context:
space:
mode:
Diffstat (limited to 'hw/bsp/board_api.h')
-rw-r--r--hw/bsp/board_api.h38
1 files changed, 22 insertions, 16 deletions
diff --git a/hw/bsp/board_api.h b/hw/bsp/board_api.h
index eaee1ee97..9cdbbf0d3 100644
--- a/hw/bsp/board_api.h
+++ b/hw/bsp/board_api.h
@@ -38,22 +38,24 @@ extern "C" {
#include "tusb.h"
-#if CFG_TUSB_OS == OPT_OS_FREERTOS
-#if TUSB_MCU_VENDOR_ESPRESSIF
- // ESP-IDF need "freertos/" prefix in include path.
- // CFG_TUSB_OS_INC_PATH should be defined accordingly.
- #include "freertos/FreeRTOS.h"
- #include "freertos/semphr.h"
- #include "freertos/queue.h"
- #include "freertos/task.h"
- #include "freertos/timers.h"
-#else
- #include "FreeRTOS.h"
- #include "semphr.h"
- #include "queue.h"
- #include "task.h"
- #include "timers.h"
-#endif
+#if CFG_TUSB_OS == OPT_OS_ZEPHYR
+ #include <zephyr/kernel.h>
+#elif CFG_TUSB_OS == OPT_OS_FREERTOS
+ #if TUSB_MCU_VENDOR_ESPRESSIF
+ // ESP-IDF need "freertos/" prefix in include path.
+ // CFG_TUSB_OS_INC_PATH should be defined accordingly.
+ #include "freertos/FreeRTOS.h"
+ #include "freertos/semphr.h"
+ #include "freertos/queue.h"
+ #include "freertos/task.h"
+ #include "freertos/timers.h"
+ #else
+ #include "FreeRTOS.h"
+ #include "semphr.h"
+ #include "queue.h"
+ #include "task.h"
+ #include "timers.h"
+ #endif
#endif
// Define the default baudrate
@@ -124,6 +126,10 @@ static inline uint32_t board_millis(void) {
// Implement your own board_millis() in any of .c file
uint32_t board_millis(void);
+#elif CFG_TUSB_OS == OPT_OS_ZEPHYR
+static inline uint32_t board_millis(void) {
+ return k_uptime_get_32();
+}
#else
#error "board_millis() is not implemented for this OS"
#endif