FastLED 3.10.9
Loading...
Searching...
No Matches

◆ canHandle()

bool fl::SpiChannelEngineAdapter::canHandle ( const ChannelDataPtr & data) const
overridevirtual

Check if adapter can handle channel data.

Parameters
dataChannel data to check
Returns
true if data is true SPI chipset (APA102, SK9822, HD108)
Note
Rejects clockless chipsets (WS2812, SK6812, etc.)

Implements fl::IChannelDriver.

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

200 {
201 if (!data) {
202 return false;
203 }
204
205 // ⚠️ CRITICAL: Accept ONLY true SPI chipsets (APA102, SK9822, HD108)
206 // Reject clockless chipsets (WS2812, SK6812) - those use ChannelEngineSpi or RMT
207 //
208 // This is the opposite of ChannelEngineSpi::canHandle(), which should be:
209 // return !data->isSpi(); // Accept clockless, reject true SPI
210 //
211 // Correct routing:
212 // APA102 → SpiChannelEngineAdapter (this adapter)
213 // WS2812 → ChannelEngineSpi (clockless-over-SPI) OR RMT/PARLIO
214 return data->isSpi();
215}

References fl::FL_NO_EXCEPT.

Referenced by enqueue().

+ Here is the caller graph for this function: