summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorSaulo VerĂ­ssimo <[email protected]>2026-03-25 07:29:10 -0300
committerSaulo VerĂ­ssimo <[email protected]>2026-05-12 11:07:44 -0300
commitf8a5fc37f3472cb2e3eb584d58e9cf4588dc4329 (patch)
tree271eee66f0c5998fd5002d7c1a4db8846afe3a93 /examples
parentfa9edeff9c00ee1fc4ee7ab9938b1a5955a6281a (diff)
fix: CI build failures on non-RP2040 platforms
- Use UINT32_C(1) instead of 1u for bit shifts >= 16 in midi2_device.c to avoid shift-count-overflow on 16-bit platforms (MSP430) - Add Makefiles for midi2_device and midi2_host examples with family guard (skip if FAMILY != rp2040). These examples require Pico SDK and board-specific hardware - Restrict midi2_device CMakeLists.txt to rp2040 family (matching midi2_host)
Diffstat (limited to 'examples')
-rw-r--r--examples/device/midi2_device/CMakeLists.txt4
-rw-r--r--examples/device/midi2_device/Makefile27
-rw-r--r--examples/host/midi2_host/Makefile27
3 files changed, 56 insertions, 2 deletions
diff --git a/examples/device/midi2_device/CMakeLists.txt b/examples/device/midi2_device/CMakeLists.txt
index 295af6550..3f4a876c9 100644
--- a/examples/device/midi2_device/CMakeLists.txt
+++ b/examples/device/midi2_device/CMakeLists.txt
@@ -7,8 +7,8 @@ project(midi2_device C CXX ASM)
# Checks this example is valid for the family and initializes the project
family_initialize_project(${PROJECT_NAME} ${CMAKE_CURRENT_LIST_DIR})
-# Espressif has its own cmake build system
-if(FAMILY STREQUAL "espressif")
+# This example requires RP2040/RP2350 (USB descriptors and config are board-specific)
+if(NOT FAMILY STREQUAL "rp2040")
return()
endif()
diff --git a/examples/device/midi2_device/Makefile b/examples/device/midi2_device/Makefile
new file mode 100644
index 000000000..09f069c4f
--- /dev/null
+++ b/examples/device/midi2_device/Makefile
@@ -0,0 +1,27 @@
+# This example requires RP2040/RP2350 (USB descriptors and config are board-specific)
+ifeq (,$(findstring rp2040,$(FAMILY)))
+$(info Skipping midi2_device: requires FAMILY=rp2040)
+all:
+ @:
+.DEFAULT:
+ @:
+else
+
+include ../../../hw/bsp/family_support.mk
+
+INC += \
+ src \
+
+# Example source
+EXAMPLE_SOURCE += \
+ src/main.c \
+ src/usb_descriptors.c \
+
+SRC_C += $(addprefix $(EXAMPLE_PATH)/, $(EXAMPLE_SOURCE))
+
+# Suppress pre-existing warning in usbd.c
+CFLAGS_GCC += -Wno-type-limits
+
+include ../../../hw/bsp/family_rules.mk
+
+endif
diff --git a/examples/host/midi2_host/Makefile b/examples/host/midi2_host/Makefile
new file mode 100644
index 000000000..2b4660516
--- /dev/null
+++ b/examples/host/midi2_host/Makefile
@@ -0,0 +1,27 @@
+# This example requires RP2040/RP2350 (PIO-USB, Pico SDK I2C, SSD1306 display)
+ifeq (,$(findstring rp2040,$(FAMILY)))
+$(info Skipping midi2_host: requires FAMILY=rp2040)
+all:
+ @:
+.DEFAULT:
+ @:
+else
+
+include ../../../hw/bsp/family_support.mk
+
+INC += \
+ src \
+
+# Example source
+EXAMPLE_SOURCE += \
+ src/main.c \
+ src/display.c \
+
+SRC_C += $(addprefix $(EXAMPLE_PATH)/, $(EXAMPLE_SOURCE))
+
+# Suppress pre-existing warning
+CFLAGS_GCC += -Wno-type-limits
+
+include ../../../hw/bsp/family_rules.mk
+
+endif