tiny optimization

* use bitmask operations in getBitFromArray, setBitInArray
* make currentBri "const"
This commit is contained in:
Frank
2025-01-17 21:13:27 +01:00
parent 7bf7ac0c33
commit 2c0063dc5b
3 changed files with 6 additions and 6 deletions

View File

@@ -616,7 +616,7 @@ typedef struct Segment {
}
// WLEDMM method inlined for speed (its called at each setPixelColor)
[[gnu::hot]] inline uint8_t currentBri(uint8_t briNew, bool useCct = false) {
[[gnu::hot]] inline uint8_t currentBri(uint8_t briNew, bool useCct = false) const {
uint32_t prog = progress();
if (prog < 0xFFFFU) { // progress() < 0xFFFFU implies that _t is valid (see progress() function)
if (useCct) return ((briNew * prog) + _t->_cctT * (0xFFFFU - prog)) >> 16;