inline frequently used color utilities (up to 15% faster)

* moving color_blend, color_add, and color_fade to a seperate file, to allow the compiler to inline the functions.

* inlining slightly increases firmware size - original non-inline functions get used on 8266, or when WLEDMM_SAVE_FLASH is defined.
This commit is contained in:
Frank
2025-01-17 21:42:26 +01:00
parent 0eec8e46c9
commit 985fa1fd3f
4 changed files with 188 additions and 2 deletions

View File

@@ -67,7 +67,7 @@ void toggleOnOff()
stateChanged = true;
}
#if !defined(ARDUINO_ARCH_ESP32) || !defined(WLEDMM_FASTPATH) || defined(WLEDMM_SAVE_FLASH) // WLEDMM color utils moved into colorTools.hpp for performance reasons
//scales the brightness with the briMultiplier factor
IRAM_ATTR_YN __attribute__((hot)) byte scaledBri(byte in) // WLEDMM added IRAM_ATTR_YN
{
@@ -76,7 +76,7 @@ IRAM_ATTR_YN __attribute__((hot)) byte scaledBri(byte in) // WLEDMM added IRAM_
if (val > 255) val = 255;
return (byte)val;
}
#endif
//applies global brightness
void applyBri() {