mirror of
https://github.com/wled/WLED.git
synced 2025-07-19 00:36:36 +00:00
Fix update for #4193 (twinkle fox & cat)
- previous fix worked but there was still an overflow after some time passed. there were still missing roll-overs apparently: reverting these two variables back to 16bit/8bit should fix it for good.
This commit is contained in:
parent
e8d9891d13
commit
076497e14d
@ -2566,10 +2566,10 @@ static CRGB twinklefox_one_twinkle(uint32_t ms, uint8_t salt, bool cat)
|
||||
// Overall twinkle speed (changed)
|
||||
unsigned ticks = ms / SEGENV.aux0;
|
||||
unsigned fastcycle8 = uint8_t(ticks);
|
||||
unsigned slowcycle16 = uint16_t((ticks >> 8) + salt);
|
||||
uint16_t slowcycle16 = (ticks >> 8) + salt;
|
||||
slowcycle16 += sin8_t(slowcycle16);
|
||||
slowcycle16 = (slowcycle16 * 2053) + 1384;
|
||||
unsigned slowcycle8 = (slowcycle16 & 0xFF) + (slowcycle16 >> 8);
|
||||
uint8_t slowcycle8 = (slowcycle16 & 0xFF) + (slowcycle16 >> 8);
|
||||
|
||||
// Overall twinkle density.
|
||||
// 0 (NONE lit) to 8 (ALL lit at once).
|
||||
|
Loading…
x
Reference in New Issue
Block a user