mirror of
https://github.com/wled/WLED.git
synced 2025-07-19 16:56:35 +00:00
Fix wipe effect smoothness
With update to 15.x many vars got changed to unsigned. Wipe relies on truncation (of an uint16_t) for modulo operation, and was therefore broken. Using directly an uint16_t like my proposal *should* be overall faster than using an unsigned and then doing a modulo. (Not an expert)
This commit is contained in:
parent
7b521c7c40
commit
a353a64568
@ -183,8 +183,7 @@ uint16_t color_wipe(bool rev, bool useRandomColors) {
|
||||
}
|
||||
|
||||
unsigned ledIndex = (prog * SEGLEN) >> 15;
|
||||
unsigned rem = 0;
|
||||
rem = (prog * SEGLEN) * 2; //mod 0xFFFF
|
||||
uint16_t rem = (prog * SEGLEN) * 2; //mod 0xFFFF by truncating
|
||||
rem /= (SEGMENT.intensity +1);
|
||||
if (rem > 255) rem = 255;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user