File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ static uint16_t mode_diffusionfire(void) {
2424 const uint8_t spark_rate = SEGMENT.intensity ;
2525 const uint8_t turbulence = SEGMENT.custom2 ;
2626
27- unsigned dataSize = SEGMENT.length () + (cols * sizeof (uint16_t ));
27+ unsigned dataSize = SEGMENT.length () + (cols * sizeof (uint16_t )) + 1 ;
2828 if (!SEGENV.allocateData (dataSize))
2929 return mode_static (); // allocation failed
3030
@@ -35,9 +35,10 @@ static uint16_t mode_diffusionfire(void) {
3535 }
3636
3737 if ((strip.now - SEGENV.step ) >= refresh_ms) {
38- // Reserve one extra byte and align to 2-byte boundary to avoid hard-faults
3938 uint8_t *bufStart = SEGMENT.data + SEGMENT.length ();
40- uintptr_t aligned = (uintptr_t (bufStart) + 1u ) & ~uintptr_t (0x1u );
39+ // Reserve one extra byte and align to 2-byte boundary to avoid hard-faults
40+ uintptr_t addr = reinterpret_cast <uintptr_t >(bufStart);
41+ uintptr_t aligned = (addr + 1 ) & ~1 ;
4142 uint16_t *tmp_row = reinterpret_cast <uint16_t *>(aligned);
4243 SEGENV.step = strip.now ;
4344 call++;
You can’t perform that action at this time.
0 commit comments