FastLED 3.9.15
Loading...
Searching...
No Matches

◆ allocate()

PwmPinState * fl::pwm_state::allocate ( )

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

152 {
153 PwmStateData& st = state();
154 for (u8 i = 0; i < MAX_PWM_CHANNELS; i++) {
155 if (st.channels[i].pin < 0) {
156 return &st.channels[i];
157 }
158 }
159 return nullptr;
160}
constexpr u8 MAX_PWM_CHANNELS
Definition pin.cpp.hpp:79
PwmStateData & state()
Definition pin.cpp.hpp:109
unsigned char u8
Definition stdint.h:131
PwmPinState channels[MAX_PWM_CHANNELS]
Definition pin.cpp.hpp:101

References fl::pwm_state::PwmStateData::channels, 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: