| 413 | } |
| 414 | |
| 415 | fl::u32 CFastLED::getEstimatedPowerInMilliWatts(bool apply_limiter) const { |
| 416 | fl::u32 total_power_mW = 0; |
| 417 | |
| 418 | // Sum unscaled power from all LED controllers using visitor pattern |
| 419 | CLEDController::visitControllers([&total_power_mW](const CLEDController* /*controller*/, fl::span<const CRGB> leds) { |
| 420 | if (!leds.empty()) { |
| 421 | total_power_mW += calculate_unscaled_power_mW(leds); |
| 422 | } |
| 423 | }); |
| 424 | |
| 425 | // Determine effective brightness |
| 426 | fl::u8 effective_brightness = mScale; |
| 427 | |
| 428 | if (apply_limiter && mPPowerFunc) { |
| 429 | // Power limiting is enabled and user wants limited power - calculate brightness after limiting |
| 430 | // This calls calculate_max_brightness_for_power_mW(mScale, mNPowerData) |
| 431 | effective_brightness = (*mPPowerFunc)(mScale, mNPowerData); |
| 432 | } |
| 433 | |
| 434 | // Scale by the configured power-brightness response. |
| 435 | // Note: MCU power consumption is NOT included - caller should add platform-specific MCU power if needed |
| 436 | return scale_power_for_brightness(total_power_mW, effective_brightness); |
| 437 | } |
| 438 | |
| 439 | // |
| 440 | // template<int m, int n> void transpose8(unsigned char A[8], unsigned char B[8]) { |
no test coverage detected