From ce2d6e96160aa1a6444f3234903f6db7aca7b675 Mon Sep 17 00:00:00 2001 From: Cooper Dalrymple Date: Mon, 30 Mar 2026 13:10:59 -0500 Subject: [PATCH 1/3] Remove unused inline functions --- shared-module/audiomixer/Mixer.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/shared-module/audiomixer/Mixer.c b/shared-module/audiomixer/Mixer.c index b27eafb71a98c..01d2a259d5e71 100644 --- a/shared-module/audiomixer/Mixer.c +++ b/shared-module/audiomixer/Mixer.c @@ -165,16 +165,6 @@ static inline uint32_t copy16msb(uint32_t val) { return val | (val >> 16); } -static inline uint32_t copy8lsb(uint32_t val) { - val &= 0x00ff; - return val | (val << 8); -} - -static inline uint32_t copy8msb(uint32_t val) { - val &= 0xff00; - return val | (val >> 8); -} - #define ALMOST_ONE (MICROPY_FLOAT_CONST(32767.) / 32768) static void mix_down_one_voice(audiomixer_mixer_obj_t *self, From 9c763bae40992196ca3a219709c1ef598a2a9e8a Mon Sep 17 00:00:00 2001 From: Cooper Dalrymple Date: Mon, 30 Mar 2026 13:16:09 -0500 Subject: [PATCH 2/3] Add ARM operations for 16-bit copy functions --- shared-module/audiomixer/Mixer.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/shared-module/audiomixer/Mixer.c b/shared-module/audiomixer/Mixer.c index 01d2a259d5e71..684f9fedaf43d 100644 --- a/shared-module/audiomixer/Mixer.c +++ b/shared-module/audiomixer/Mixer.c @@ -156,13 +156,21 @@ static inline uint32_t pack8(uint32_t val) { } static inline uint32_t copy16lsb(uint32_t val) { + #if (defined(__ARM_ARCH_7EM__) && (__ARM_ARCH_7EM__ == 1)) + return __PKHBT(val, val, 16); + #else val &= 0x0000ffff; return val | (val << 16); + #endif; } static inline uint32_t copy16msb(uint32_t val) { + #if (defined(__ARM_ARCH_7EM__) && (__ARM_ARCH_7EM__ == 1)) + return __PKHTB(val, val, 16); + #else val &= 0xffff0000; return val | (val >> 16); + #endif; } #define ALMOST_ONE (MICROPY_FLOAT_CONST(32767.) / 32768) From 8fcd82385be7826617a042e2259081651465fbab Mon Sep 17 00:00:00 2001 From: Cooper Dalrymple Date: Mon, 30 Mar 2026 17:04:04 -0500 Subject: [PATCH 3/3] Remove extra tokens from #endif directives --- shared-module/audiomixer/Mixer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shared-module/audiomixer/Mixer.c b/shared-module/audiomixer/Mixer.c index 684f9fedaf43d..64488cc429725 100644 --- a/shared-module/audiomixer/Mixer.c +++ b/shared-module/audiomixer/Mixer.c @@ -161,7 +161,7 @@ static inline uint32_t copy16lsb(uint32_t val) { #else val &= 0x0000ffff; return val | (val << 16); - #endif; + #endif } static inline uint32_t copy16msb(uint32_t val) { @@ -170,7 +170,7 @@ static inline uint32_t copy16msb(uint32_t val) { #else val &= 0xffff0000; return val | (val >> 16); - #endif; + #endif } #define ALMOST_ONE (MICROPY_FLOAT_CONST(32767.) / 32768)