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

◆ setMaxRefreshRate()

void CFastLED::setMaxRefreshRate ( fl::u16 refresh,
bool constrain = false )

Set the maximum refresh rate.

This is global for all leds. Attempts to call show() faster than this rate will simply wait.

Note
The refresh rate defaults to the slowest refresh rate of all the leds added through addLeds(). If you wish to set/override this rate, be sure to call setMaxRefreshRate() after adding all of your leds.
Parameters
refreshmaximum refresh rate in hz
constrainconstrain refresh rate to the slowest speed yet set

Definition at line 710 of file FastLED.cpp.hpp.

710 {
711 if(constrain) {
712 // When constraining we may only slow things down: keep the lower cap.
713 if(refresh > 0 && (mMaxRefreshHz == 0 || refresh < mMaxRefreshHz)) {
714 mMaxRefreshHz = refresh;
715 }
716 } else {
717 mMaxRefreshHz = refresh; // 0 = unlimited
718 }
719}
fl::u16 mMaxRefreshHz
frame-rate cap in Hz, 0 = unlimited (u16 saves 2 B over micros, #4788)
Definition FastLED.h:729

References FL_NO_EXCEPT, and mMaxRefreshHz.