Skip to content

Commit

Permalink
[tinyusb] Do not use FreeRTOS abstraction layer
Browse files Browse the repository at this point in the history
  • Loading branch information
rleh committed Jan 31, 2022
1 parent 6b257c6 commit aa24f4a
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions ext/hathach/module.lb
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,16 @@ def build(env):
tusb_config["CFG_TUSB_MCU"] = "OPT_MCU_RP2040"
env.copy("tinyusb/src/portable/raspberrypi/rp2040/", "portable/raspberrypi/rp2040/")

# TinyUSB has a OS abstraction layer for FreeRTOS, but it is causes problems with modm
# if env.has_module(":freertos"):
# tusb_config["CFG_TUSB_OS"] = "OPT_OS_FREERTOS"
# env.copy("tinyusb/src/osal/osal_freertos.h", "osal/osal_freertos.h")

if env.has_module(":freertos"):
tusb_config["CFG_TUSB_OS"] = "OPT_OS_FREERTOS"
env.copy("tinyusb/src/osal/osal_freertos.h", "osal/osal_freertos.h")
else:
env.copy("tinyusb/src/osal/osal_none.h", "osal/osal_none.h")
env.log.warning("TinyUSB in modm does not currently use the FreeRTOS abstraction layer"
" and is not thread-safe with FreeRTOS threads.")

env.copy("tinyusb/src/osal/osal_none.h", "osal/osal_none.h")

if env.has_module(":debug"):
tusb_config["CFG_TUSB_DEBUG_PRINTF"] = "tinyusb_debug_printf"
Expand Down

0 comments on commit aa24f4a

Please sign in to comment.