MCPcopy Create free account
hub / github.com/FastLED/FastLED / poll

Method poll

src/platforms/esp/32/drivers/uart/channel_driver_uart.cpp.hpp:170–205  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

168}
169
170IChannelDriver::DriverState ChannelEngineUART::poll() FL_NOEXCEPT {
171 // If not initialized, we're ready (no hardware to poll)
172 if (!mInitialized) {
173 return DriverState::READY;
174 }
175
176 // Poll UART peripheral state
177 bool busy = mPeripheral->isBusy();
178
179 if (!busy) {
180 // Current group completed - check if more groups need transmission
181 if (!mChipsetGroups.empty() &&
182 mCurrentGroupIndex < mChipsetGroups.size() - 1) {
183 // More groups remaining - start next group
184 mCurrentGroupIndex++;
185
186 bool is_last_group =
187 (mCurrentGroupIndex == mChipsetGroups.size() - 1);
188
189 beginTransmission(fl::span<const ChannelDataPtr>(
190 mChipsetGroups[mCurrentGroupIndex].mChannels.data(),
191 mChipsetGroups[mCurrentGroupIndex].mChannels.size()));
192
193 return is_last_group ? DriverState::DRAINING : DriverState::READY;
194 }
195
196 // All groups completed - clear state and return READY
197 mTransmittingChannels.clear();
198 mChipsetGroups.clear();
199 mCurrentGroupIndex = 0;
200 return DriverState::READY;
201 }
202
203 // Transmission in progress - return DRAINING
204 return DriverState::DRAINING;
205}
206
207//=============================================================================
208// Private Methods - LUT Cache

Callers

nothing calls this directly

Calls 5

isBusyMethod · 0.45
emptyMethod · 0.45
sizeMethod · 0.45
dataMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected