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

◆ allocate()

PwmPinState * fl::pwm_state::allocate ( )

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

166 {
167 PwmStateData& st = state();
168 for (u8 i = 0; i < MAX_PWM_CHANNELS; i++) {
169 if (st.channels[i].pin < 0) {
170 return &st.channels[i];
171 }
172 }
173 return nullptr;
174}
constexpr u8 MAX_PWM_CHANNELS
Definition pin.cpp.hpp:78
PwmStateData & state() FL_NO_EXCEPT
Definition pin.cpp.hpp:118
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: