FastLED 3.9.15
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 196 of file spi_channel_adapter.cpp.hpp.

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

Referenced by enqueue().

+ Here is the caller graph for this function: