summaryrefslogtreecommitdiff
path: root/src
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 /src
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 'src')
-rw-r--r--src/class/midi/midi2_device.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/class/midi/midi2_device.c b/src/class/midi/midi2_device.c
index aecbda4c5..0029737ce 100644
--- a/src/class/midi/midi2_device.c
+++ b/src/class/midi/midi2_device.c
@@ -158,10 +158,10 @@ static void _nego_send_endpoint_info(midi2d_interface_t* p_midi) {
| ((uint32_t) STREAM_ENDPOINT_INFO << 16)
| ((uint32_t) UMP_VER_MAJOR << 8)
| (uint32_t) UMP_VER_MINOR;
- msg[1] = (1u << 31) // Static Function Blocks flag
+ msg[1] = (UINT32_C(1) << 31) // Static Function Blocks flag
| ((uint32_t)(CFG_TUD_MIDI2_NUM_FUNCTION_BLOCKS & 0x7F) << 24)
- | (1u << 9) // MIDI 2.0 Protocol capability
- | (1u << 8); // MIDI 1.0 Protocol capability
+ | (UINT32_C(1) << 9) // MIDI 2.0 Protocol capability
+ | (UINT32_C(1) << 8); // MIDI 1.0 Protocol capability
_nego_send_ump(p_midi, msg, 4);
}
@@ -214,7 +214,7 @@ static void _nego_send_fb_info(midi2d_interface_t* p_midi, uint8_t fb_idx) {
uint32_t msg[4] = {0};
msg[0] = ((uint32_t) MT_STREAM << 28)
| ((uint32_t) STREAM_FB_INFO << 16)
- | (1u << 15)
+ | (UINT32_C(1) << 15)
| ((uint32_t) fb_idx << 8)
| 0x02; // bDirection: bidirectional
msg[1] = ((uint32_t) 0 << 24) // bFirstGroup