Merge pull request #2832 from HHHartmann/ws2812-buffer-mix
fix rounding in ws2812:buffer:mix Looks good to me.
This commit is contained in:
commit
891799279d
|
@ -425,6 +425,7 @@ static int ws2812_buffer_mix(lua_State* L) {
|
|||
val += (int32_t)(source[src].values[i] * source[src].factor);
|
||||
}
|
||||
|
||||
val += 128; // rounding istead of floor
|
||||
val >>= 8;
|
||||
|
||||
if (val < 0) {
|
||||
|
|
Loading…
Reference in New Issue