FastLED 3.10.9
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 714 of file FastLED.cpp.hpp.

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

References FL_NO_EXCEPT, and mMaxRefreshHz.