We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent dc136bf commit d54bb92Copy full SHA for d54bb92
usermods/user_fx/user_fx.cpp
@@ -35,7 +35,10 @@ static uint16_t mode_diffusionfire(void) {
35
}
36
37
if ((strip.now - SEGENV.step) >= refresh_ms) {
38
- uint16_t *tmp_row = (uint16_t *)(SEGMENT.data + SEGMENT.length());
+ // Reserve one extra byte and align to 2-byte boundary to avoid hard-faults
39
+ uint8_t *bufStart = SEGMENT.data + SEGMENT.length();
40
+ uintptr_t aligned = (uintptr_t(bufStart) + 1u) & ~uintptr_t(0x1u);
41
+ uint16_t *tmp_row = reinterpret_cast<uint16_t *>(aligned);
42
SEGENV.step = strip.now;
43
call++;
44
0 commit comments