Skip to content

Commit aa24f4a

Browse files
committed
[tinyusb] Do not use FreeRTOS abstraction layer
1 parent 6b257c6 commit aa24f4a

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

ext/hathach/module.lb

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,16 @@ def build(env):
113113
tusb_config["CFG_TUSB_MCU"] = "OPT_MCU_RP2040"
114114
env.copy("tinyusb/src/portable/raspberrypi/rp2040/", "portable/raspberrypi/rp2040/")
115115

116+
# TinyUSB has a OS abstraction layer for FreeRTOS, but it is causes problems with modm
117+
# if env.has_module(":freertos"):
118+
# tusb_config["CFG_TUSB_OS"] = "OPT_OS_FREERTOS"
119+
# env.copy("tinyusb/src/osal/osal_freertos.h", "osal/osal_freertos.h")
120+
116121
if env.has_module(":freertos"):
117-
tusb_config["CFG_TUSB_OS"] = "OPT_OS_FREERTOS"
118-
env.copy("tinyusb/src/osal/osal_freertos.h", "osal/osal_freertos.h")
119-
else:
120-
env.copy("tinyusb/src/osal/osal_none.h", "osal/osal_none.h")
122+
env.log.warning("TinyUSB in modm does not currently use the FreeRTOS abstraction layer"
123+
" and is not thread-safe with FreeRTOS threads.")
124+
125+
env.copy("tinyusb/src/osal/osal_none.h", "osal/osal_none.h")
121126

122127
if env.has_module(":debug"):
123128
tusb_config["CFG_TUSB_DEBUG_PRINTF"] = "tinyusb_debug_printf"

0 commit comments

Comments
 (0)