Cold slow-path helper for showPixels() when the driver was NOT pre-bound via setDriver().
Cold fallback for the non-pre-bound driver path.
Handles dynamic ChannelManager::selectDriverForChannel() lookup AND the bus-key-miss diagnostics (#2455 / #2459).
Marked FL_NO_INLINE so the legacy addLeds<> hot path stays 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 legacy addLeds<> path stays compact — see #2773 item 2.1.
Marked noinline (via FL_NOINLINE) so the compiler doesn't fold the cold body back into showPixels. The whole helper is reachable only when mDriverPreBound == false, which on stock Blink is never true — LTO can use that across the call site to keep the cold body off the hot icache line.
Definition at line 391 of file channel.cpp.hpp.
391 {
392#if defined(FASTLED_DISABLE_DYNAMIC_DRIVER) && FASTLED_DISABLE_DYNAMIC_DRIVER
393
394
395
396
397 return {};
398#else
399
400 fl::string busKey;
403 }
404
405 fl::shared_ptr<IChannelDriver> driver =
408
409
410
411
412
413
414#if FASTLED_LOG_RUNTIME_ENABLED
416 (!driver || driver->getName() != busKey)) {
418 if (!busDriver) {
419
420
422 << "' wasn't instantiated. Resolve with: "
423 << "(1) fl::enableDrivers<fl::Bus::" << busKey << ">() "
424 << "(links only this driver), "
425 << "(2) FastLED.enableAllDrivers() (links every driver), or "
426 << "(3) FastLED.addLeds<..., fl::Bus::" << busKey << ">(...) "
427 << "(legacy API; pins Bus + triggers linker keep-alive). "
428 << "Defaulting to AUTO/priority dispatch.");
429 } else {
430
432 << "' is registered but cannot handle this channel's chipset "
433 << "(bus/chipset mismatch). Defaulting to AUTO/priority dispatch.");
434 }
436 }
437 if (!driver) {
438 FL_ERROR(
"Channel '" <<
mName <<
"': No compatible driver found - cannot transmit");
439 }
440#endif
441
442
443
444
445 return driver;
446#endif
447}
ChannelDataPtr mChannelData
fl::weak_ptr< IChannelDriver > mDriver
fl::shared_ptr< IChannelDriver > selectDriverForChannel(const ChannelDataPtr &data, const fl::string &affinity) FL_NOEXCEPT
Select best driver for channel data (used by Channel::showPixels)
fl::shared_ptr< IChannelDriver > findDriverByName(const fl::string &name) const FL_NOEXCEPT
Silent counterpart to getDriverByName().
static ChannelManager & instance() FL_NOEXCEPT
Get the global singleton instance.
static string from_literal(const char *literal) FL_NOEXCEPT
const char * busName(Bus b) FL_NOEXCEPT
Canonical driver-name string for a Bus value.
@ AUTO
Sentinel: defer to DefaultBus<Chipset>::value.
References fl::AUTO, fl::busName(), fl::ChannelManager::findDriverByName(), FL_ERROR, fl::string::from_literal(), fl::ChannelManager::instance(), mBus, mBusWarned, mChannelData, mDriver, mName, and fl::ChannelManager::selectDriverForChannel().
Referenced by showPixels().