Cold slow-path helper for showPixels().
Resolve the driver for this channel.
Handles dynamic ChannelManager::selectDriverForChannel() lookup AND the bus-key-miss diagnostics (#2455 / #2459). This is now the only driver-resolution path.
Marked FL_NO_INLINE to keep showPixels() compact – see #2773 item 2.1. Returns nullptr on a hard miss (caller should silently bail).
Handles dynamic ChannelManager::selectDriverForChannel lookup AND the bus-key-miss diagnostic chain. Hoisted out of showPixels so the hot path stays compact – see #2773 item 2.1. This is the only driver-resolution path; there is no pre-bound fast path.
Marked noinline (via FL_NO_INLINE) so the compiler doesn't fold the cold body back into showPixels.
Definition at line 829 of file channel.cpp.hpp.
829 {
830#if defined(FASTLED_DISABLE_DYNAMIC_DRIVER) && FASTLED_DISABLE_DYNAMIC_DRIVER
831
832
833
834
835 return {};
836#else
837
838 fl::string busKey;
841 }
842
843 fl::shared_ptr<IChannelDriver> driver =
846
847
848
849
850
851
852#if FASTLED_LOG_RUNTIME_ENABLED
854 (!driver || driver->getName() != busKey)) {
856 if (!busDriver) {
857
858
859 FL_ERROR(
"Channel '" <<
mName <<
"': Driver '" << busKey <<
"' wasn't instantiated. Resolve with: (1) fl::enableDrivers<fl::Bus::" << busKey <<
">() (links only this driver), (2) FastLED.enableAllDrivers() (links every driver), or (3) FastLED.addLeds<..., fl::Bus::" << busKey <<
">(...) (legacy API; pins Bus + triggers linker keep-alive). Defaulting to AUTO/priority dispatch.");
860 } else {
861
862 FL_ERROR(
"Channel '" <<
mName <<
"': Driver '" << busKey <<
"' is registered but cannot handle this channel's chipset (bus/chipset mismatch). Defaulting to AUTO/priority dispatch.");
863 }
865 }
866 if (!driver) {
867 FL_ERROR(
"Channel '" <<
mName <<
"': No compatible driver found - cannot transmit");
868 }
869#endif
870
871
872
873
874 return driver;
875#endif
876}
bool isSpi() const FL_NO_EXCEPT
Check if this is an SPI chipset.
ChannelDataPtr mChannelData
fl::weak_ptr< IChannelDriver > mDriver
fl::shared_ptr< IChannelDriver > findDriverByName(const fl::string &name) const FL_NO_EXCEPT
Silent counterpart to getDriverByName().
static ChannelManager & instance() FL_NO_EXCEPT
Get the global singleton instance.
fl::shared_ptr< IChannelDriver > selectDriverForChannel(const ChannelDataPtr &data, const fl::string &affinity) FL_NO_EXCEPT
Select best driver for channel data (used by Channel::showPixels)
static string from_literal(const char *literal) FL_NO_EXCEPT
const char * busDriverName(Bus b, fl::u8 which=0, bool spi=false) FL_NO_EXCEPT
Concrete ChannelManager driver name for a portable bus.
References fl::AUTO, fl::busDriverName(), fl::ChannelManager::findDriverByName(), FL_ERROR, fl::FL_NO_EXCEPT, fl::string::from_literal(), fl::ChannelManager::instance(), isSpi(), mBus, mBusWarned, mBusWhich, mChannelData, mDriver, mName, and fl::ChannelManager::selectDriverForChannel().
Referenced by showPixels().