FastLED 3.10.8
Loading...
Searching...
No Matches

◆ controller_unscaled_power_mW()

fl::u32 controller_unscaled_power_mW ( const fl::CLEDController & controller)

One controller's demand at full brightness, in mW, including idle draw – the quantity the limiter sums and scales.

A controller whose output runs through a colour pipeline is charged for the drives the pipeline solves, not for its source pixels: the two differ in either direction, by up to 4.45x on dim emitters (#4344, #4156 R3). Any other controller is charged through its RGBW conversion, as before.

Definition at line 485 of file power_mgt.cpp.hpp.

485 {
487 static_cast<fl::size>(controller.size()));
488#if FL_COLOR_PIPELINE_SHARED
489 // Through the pipeline hook, which exists whenever a pipeline does; naming
490 // the estimator directly would link the colour pipeline into sketches that
491 // limit power but never bind a profile. `pipeline` is this estimate's own
492 // reference, so reconfiguring the controller mid-pass cannot free the
493 // pipeline it is walking (#4440).
494 const fl::shared_ptr<fl::StreamingPipelineQ16> pipeline = fl::channelColorPipeline(controller);
496 if (pipeline && hooks.unscaledPowerMilliwatts != nullptr) {
497 // The callback charges already-solved physical emitter bytes. In
498 // particular, the RGBW legacy estimator must not convert them again.
499 const fl::u8 emitters = controller.getRgbww().active()
500 ? 5 : (controller.getRgbw().active() ? 4 : 3);
501 return hooks.unscaledPowerMilliwatts(
502 *pipeline, leds, emitters, &calculate_unscaled_emitter_power_mW);
503 }
504#endif
505 // Below the large-memory tier only this is compiled: a managed channel
506 // there is charged for its source (FL_COLOR_PIPELINE_SHARED).
507 // No stored Rgbw reads as RgbwInvalid, which the overload answers with the
508 // RGB estimate; asking for it directly skips copying the Rgbw value.
509 const fl::Rgbw* rgbw = controller.rgbwConfig();
512}
CRGB leds[1]
CLEDController * controller
Rgbw rgbw
fl::u32 calculate_unscaled_power_mW(fl::span< const CRGB > leds) FL_NO_EXCEPT
Determines how many milliwatts the current LED data would draw at max brightness (255)
fl::u32 calculate_unscaled_emitter_power_mW(fl::span< const fl::u8 > codes, fl::u8 emitter_count) FL_NO_EXCEPT
Charge already-solved physical output bytes in source emitter order: RGB, RGBW, or RGB + warm white +...
unsigned char u8
Definition stdint.h:131
ColorPipelineHooks & colorPipelineHooks() FL_NO_EXCEPT
The installed hooks.
static rgbw_power_fn gRgbwPowerEstimate

References calculate_unscaled_emitter_power_mW(), calculate_unscaled_power_mW(), fl::colorPipelineHooks(), controller, FL_NO_EXCEPT, gRgbwPowerEstimate, leds, and rgbw.

Referenced by calculate_max_brightness_for_power_mW(), and CFastLED::getEstimatedPowerInMilliWatts().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: