summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/device/midi_test_freertos/CMakeLists.txt2
-rw-r--r--examples/device/midi_test_freertos/Makefile19
-rw-r--r--examples/device/midi_test_freertos/src/tusb_config.h2
3 files changed, 19 insertions, 4 deletions
diff --git a/examples/device/midi_test_freertos/CMakeLists.txt b/examples/device/midi_test_freertos/CMakeLists.txt
index eb2f0fe21..33f3b915f 100644
--- a/examples/device/midi_test_freertos/CMakeLists.txt
+++ b/examples/device/midi_test_freertos/CMakeLists.txt
@@ -28,6 +28,6 @@ target_include_directories(${PROJECT} PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/src
)
-# Configure compilation flags and libraries for the example without RTOS.
+# Configure compilation flags and libraries for the example with FreeRTOS.
# See the corresponding function in hw/bsp/FAMILY/family.cmake for details.
family_configure_device_example(${PROJECT} freertos)
diff --git a/examples/device/midi_test_freertos/Makefile b/examples/device/midi_test_freertos/Makefile
index 7d45405a2..0f504bbe6 100644
--- a/examples/device/midi_test_freertos/Makefile
+++ b/examples/device/midi_test_freertos/Makefile
@@ -1,8 +1,14 @@
include ../../build_system/make/make.mk
+FREERTOS_SRC = lib/FreeRTOS-Kernel
+FREERTOS_PORTABLE_PATH = $(FREERTOS_SRC)/portable/$(if $(findstring iar,$(TOOLCHAIN)),IAR,GCC)
+
INC += \
- src \
- $(TOP)/hw \
+ src \
+ $(TOP)/hw \
+ ${TOP}/${FAMILY_PATH}/FreeRTOSConfig \
+ $(TOP)/$(FREERTOS_SRC)/include \
+ $(TOP)/$(FREERTOS_PORTABLE_SRC) \
# Example source
EXAMPLE_SOURCE += \
@@ -22,4 +28,13 @@ SRC_C += \
SRC_S += \
$(subst $(TOP)/,,$(wildcard $(TOP)/$(FREERTOS_PORTABLE_SRC)/*.s))
+# Suppress FreeRTOSConfig.h warnings
+CFLAGS_GCC += -Wno-error=redundant-decls
+
+# Suppress FreeRTOS source warnings
+CFLAGS_GCC += -Wno-error=cast-qual
+
+# FreeRTOS (lto + Os) linker issue
+LDFLAGS_GCC += -Wl,--undefined=vTaskSwitchContext
+
include ../../build_system/make/rules.mk
diff --git a/examples/device/midi_test_freertos/src/tusb_config.h b/examples/device/midi_test_freertos/src/tusb_config.h
index 314dde438..0ffdc37fb 100644
--- a/examples/device/midi_test_freertos/src/tusb_config.h
+++ b/examples/device/midi_test_freertos/src/tusb_config.h
@@ -54,7 +54,7 @@
#endif
#ifndef CFG_TUSB_OS
-#define CFG_TUSB_OS OPT_OS_NONE
+#define CFG_TUSB_OS OPT_OS_FREERTOS
#endif
#ifndef CFG_TUSB_DEBUG