Skip to content

Commit c370c70

Browse files
committed
fix build with midi_test_freertos
1 parent 34346d6 commit c370c70

File tree

3 files changed

+19
-4
lines changed

3 files changed

+19
-4
lines changed

examples/device/midi_test_freertos/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@ target_include_directories(${PROJECT} PUBLIC
2828
${CMAKE_CURRENT_SOURCE_DIR}/src
2929
)
3030

31-
# Configure compilation flags and libraries for the example without RTOS.
31+
# Configure compilation flags and libraries for the example with FreeRTOS.
3232
# See the corresponding function in hw/bsp/FAMILY/family.cmake for details.
3333
family_configure_device_example(${PROJECT} freertos)

examples/device/midi_test_freertos/Makefile

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
include ../../build_system/make/make.mk
22

3+
FREERTOS_SRC = lib/FreeRTOS-Kernel
4+
FREERTOS_PORTABLE_PATH = $(FREERTOS_SRC)/portable/$(if $(findstring iar,$(TOOLCHAIN)),IAR,GCC)
5+
36
INC += \
4-
src \
5-
$(TOP)/hw \
7+
src \
8+
$(TOP)/hw \
9+
${TOP}/${FAMILY_PATH}/FreeRTOSConfig \
10+
$(TOP)/$(FREERTOS_SRC)/include \
11+
$(TOP)/$(FREERTOS_PORTABLE_SRC) \
612

713
# Example source
814
EXAMPLE_SOURCE += \
@@ -22,4 +28,13 @@ SRC_C += \
2228
SRC_S += \
2329
$(subst $(TOP)/,,$(wildcard $(TOP)/$(FREERTOS_PORTABLE_SRC)/*.s))
2430

31+
# Suppress FreeRTOSConfig.h warnings
32+
CFLAGS_GCC += -Wno-error=redundant-decls
33+
34+
# Suppress FreeRTOS source warnings
35+
CFLAGS_GCC += -Wno-error=cast-qual
36+
37+
# FreeRTOS (lto + Os) linker issue
38+
LDFLAGS_GCC += -Wl,--undefined=vTaskSwitchContext
39+
2540
include ../../build_system/make/rules.mk

examples/device/midi_test_freertos/src/tusb_config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
#endif
5555

5656
#ifndef CFG_TUSB_OS
57-
#define CFG_TUSB_OS OPT_OS_NONE
57+
#define CFG_TUSB_OS OPT_OS_FREERTOS
5858
#endif
5959

6060
#ifndef CFG_TUSB_DEBUG

0 commit comments

Comments
 (0)