Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Power management doesn't take color/temp correction into account #697
The power limiting functions don't take the color correction and color temperature adjustments into account. So, worst case, if you set color correction to 255,0,0, e.g. green and blue are 100% off no matter what, and you try to show a strip of pixels that are all green, plus one red one, the power calculation assumes that the green pixels are all lit and drawing power, and thus (may) dim down the red one -- even though there is no power being drawn by the 'green' pixels.
Either calculate_max_brightness_for_power_mW should take this into account, OR CFastLED::show should take it into account, but not both.
Another stray thought: it might be nice if CFastLED::show somehow stored the last brightness or power consumption value, so that code could see what just happened, without having to re-calculate the power draw. It'd cost us a couple of bytes of SRAM, which might or might not be worth it, so I'm still just thinking about this. I suspect that since most people wouldn't use it, the burden of 're-calculating' the power draw should be on the few people who do want that reading, without a 2-byte tax on literally everyone.