From ed0a7edd2f89b80c84a950b9b046f40a96737034 Mon Sep 17 00:00:00 2001 From: Ben Isaacs <75862+ben-xo@users.noreply.github.com> Date: Thu, 26 Aug 2021 17:19:39 +0100 Subject: Using an | instead of + is 4 instructions faster. --- src/lib8tion/math8.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib8tion/math8.h b/src/lib8tion/math8.h index fe355e89..61b12e6a 100644 --- a/src/lib8tion/math8.h +++ b/src/lib8tion/math8.h @@ -504,7 +504,7 @@ LIB8STATIC uint8_t blend8( uint8_t a, uint8_t b, uint8_t amountOfB) // result = 256*A + B - A*amountOfB + B*amountOfB // 1 or 2 cycles depending on how the compiler optimises - partial = (a << 8) + b; + partial = (a << 8) | b; // 7 cycles asm volatile ( -- cgit v1.2.3