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

◆ show()

void fl::SpiChannelEngineAdapter::show ( )
overridevirtual

Trigger transmission of enqueued data.

Note
Groups channels by clock pin, acquires DMA buffers, calls transmit()

Implements fl::IChannelDriver.

Definition at line 229 of file spi_channel_adapter.cpp.hpp.

229 {
230 if (mEnqueuedChannels.empty()) {
231 return;
232 }
233
234 FL_DBG("SpiChannelEngineAdapter: show() called with " << mEnqueuedChannels.size() << " channels");
235
236 // Move enqueued channels to transmitting list
238 mEnqueuedChannels.clear();
239
240 // Group channels by clock pin
241 // Channels with the same clock pin can share SPI bus configuration
243
244 FL_DBG("SpiChannelEngineAdapter: Grouped into " << groups.size() << " clock pin groups");
245
246 // Transmit each group sequentially
247 for (size_t i = 0; i < groups.size(); i++) {
248 const ClockPinGroup& group = groups[i];
249
250 FL_DBG("SpiChannelEngineAdapter: Transmitting group with clock pin " << group.clockPin << " (" << group.channels.size() << " channels)");
251
252 if (!transmitBatch(group.channels)) {
253 FL_WARN("SpiChannelEngineAdapter: Failed to transmit batch for clock pin " << group.clockPin);
254 // Continue with other groups rather than aborting entirely
255 }
256 }
257
258 FL_DBG("SpiChannelEngineAdapter: show() complete");
259}
bool transmitBatch(fl::span< const ChannelDataPtr > channels) FL_NO_EXCEPT
Transmit a batch of channels (all same clock pin)
fl::vector< ClockPinGroup > groupByClockPin(fl::span< const ChannelDataPtr > channels) FL_NO_EXCEPT
Group channels by clock pin for efficient transmission.
fl::vector< ChannelDataPtr > mEnqueuedChannels
Channels waiting for show()
fl::vector< ChannelDataPtr > mTransmittingChannels
Channels currently transmitting.
Group data structure for channels with same clock pin.
#define FL_WARN(...)
Definition log.h:437
#define FL_DBG
Definition log.h:553
constexpr remove_reference< T >::type && move(T &&t) FL_NO_EXCEPT
Definition move.h:30

References fl::SpiChannelEngineAdapter::ClockPinGroup::channels, fl::SpiChannelEngineAdapter::ClockPinGroup::clockPin, FL_DBG, fl::FL_NO_EXCEPT, FL_WARN, groupByClockPin(), mEnqueuedChannels, fl::adl_barrier::move(), mTransmittingChannels, fl::vector_basic::size(), and transmitBatch().

+ Here is the call graph for this function: