FastLED 3.10.9
Loading...
Searching...
No Matches

◆ allocate()

PwmPinState * fl::pwm_state::allocate ( )

Definition at line 167 of file pin.cpp.hpp.

167 {
168 PwmStateData& st = state();
169 for (u8 i = 0; i < MAX_PWM_CHANNELS; i++) {
170 if (st.channels[i].pin < 0) {
171 return &st.channels[i];
172 }
173 }
174 return nullptr;
175}
constexpr u8 MAX_PWM_CHANNELS
Definition pin.cpp.hpp:78
PwmStateData & state() FL_NO_EXCEPT
Definition pin.cpp.hpp:119
unsigned char u8
Definition stdint.h:131
PwmPinState channels[MAX_PWM_CHANNELS]
Definition pin.cpp.hpp:100

References fl::pwm_state::PwmStateData::channels, fl::FL_NO_EXCEPT, MAX_PWM_CHANNELS, fl::pwm_state::PwmPinState::pin, and state().

Referenced by fl::setPwmFrequency().

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