FastLED 3.10.9
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 233 of file spi_channel_adapter.cpp.hpp.

233 {
234 if (mEnqueuedChannels.empty()) {
235 return;
236 }
237
238 FL_DBG("SpiChannelEngineAdapter: show() called with " << mEnqueuedChannels.size() << " channels");
239
240 // Move enqueued channels to transmitting list
242 mEnqueuedChannels.clear();
243
244 // Group adjacent channels with identical SPI bus configuration.
246
247 FL_DBG("SpiChannelEngineAdapter: Grouped into " << groups.size() << " SPI configuration groups");
248
249 // Transmit each group sequentially
250 for (size_t i = 0; i < groups.size(); i++) {
251 const ClockPinGroup& group = groups[i];
252
253 FL_DBG("SpiChannelEngineAdapter: Transmitting group with clock pin " << group.clockPin << " (" << group.channels.size() << " channels)");
254
255 if (!transmitBatch(group.channels)) {
256 FL_WARN("SpiChannelEngineAdapter: Failed to transmit batch for clock pin " << group.clockPin);
257 // Continue with other groups rather than aborting entirely
258 }
259 }
260
261 FL_DBG("SpiChannelEngineAdapter: show() complete");
262}
bool transmitBatch(fl::span< const ChannelDataPtr > channels) FL_NO_EXCEPT
Transmit a batch of channels sharing one SPI configuration.
fl::vector< ClockPinGroup > groupByClockPin(fl::span< const ChannelDataPtr > channels) FL_NO_EXCEPT
Group adjacent channels with matching pins, host, and clock rate.
fl::vector< ChannelDataPtr > mEnqueuedChannels
Channels waiting for show()
fl::vector< ChannelDataPtr > mTransmittingChannels
Channels currently transmitting.
Channels sharing one SPI bus configuration.
#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 s16x16x4.h:30

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

+ Here is the call graph for this function: