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 849 of file channel.cpp.hpp.
849 {
850#if defined(FASTLED_DISABLE_DYNAMIC_DRIVER) && FASTLED_DISABLE_DYNAMIC_DRIVER
851
852
853
854
855 return {};
856#else
857
858 fl::string busKey;
861 }
862
863 fl::shared_ptr<IChannelDriver> driver =
866
867
868 if (!driver || (
mBus !=
Bus::AUTO && driver->getName() != busKey) ||
870 FL_ERROR(
"Channel: worker configuration rejected - dropping frame");
872 return {};
873 }
874 }
876
877
878
879
880#if FASTLED_LOG_RUNTIME_ENABLED
881 if (
mBus !=
Bus::AUTO && (!driver || driver->getName() != busKey)) {
882
883
884 const fl::string using_name = driver ? driver->getName()
887 if (!busDriver) {
889 << "' is not enabled - falling back to " << using_name
890 << ". Fix: FastLED.enable<fl::Bus::" << busKey
891 << ">() (links only this driver) or FastLED.enableAllDrivers().");
894 << "' is disabled - falling back to " << using_name
895 << ". Fix: FastLED.setDriverEnabled(\"" << busKey
896 << "\", true), or drop the setExclusiveDriver() that disabled it.");
897 } else {
899 << "' cannot handle this chipset (bus/chipset mismatch) - falling back to "
900 << using_name << ". Fix: pick a bus that supports this chipset.");
901 }
902 }
903 if (!driver) {
904 FL_ERROR(
"Channel '" <<
mName <<
"': No compatible driver found - cannot transmit");
905 }
906#endif
907
908
909
910
911 return driver;
912#endif
913}
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
#define FL_WARN_EVERY(MILLIS,...)
const char * busDriverName(Bus b, fl::u8 which=0, bool spi=false) FL_NO_EXCEPT
Concrete ChannelManager driver name for a portable bus.
constexpr bool isDefault() const FL_NO_EXCEPT
References fl::AUTO, fl::busDriverName(), fl::ChannelManager::findDriverByName(), FL_ERROR, fl::FL_NO_EXCEPT, FL_WARN_EVERY, fl::string::from_literal(), fl::ChannelManager::instance(), isSpi(), mBus, mBusWhich, mChannelData, mDriver, mName, mSettings, and fl::ChannelManager::selectDriverForChannel().
Referenced by showPixels().