Unverified Commit 89179927 authored by Philip Gladstone's avatar Philip Gladstone Committed by GitHub
Browse files

Merge pull request #2832 from HHHartmann/ws2812-buffer-mix

fix rounding in ws2812:buffer:mix

Looks good to me.
parents a0d06822 bd0549ac
......@@ -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) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment