FastLED 3.9.15
Loading...
Searching...
No Matches
channel_typed.h File Reference

Detailed Description

Phase 3b templated channel facade – Channel<Bus, Chipset> with compile-time bus/chipset enforcement.

This header introduces the templated Channel<B, Chipset> form requested by issue #2428. It is intentionally a thin wrapper around the non-template fl::Channel runtime object so that:

  • Existing Channel::create(cfg) callers and addLeds<>() subclasses of the non-template Channel keep working unchanged (zero source impact).
  • The new templated entry point (Channel<B, Chipset>::create(cfg), FastLED.add<B, Chipset>(cfg)) enforces the Bus<->Chipset contract at compile time via static_assert(BusSupports<B, Chipset>::value, ...).
  • Specifying an undefined Bus for the current platform produces a clean "implicit instantiation of undefined template `BusTraits<Bus::X>`" diagnostic rather than a silent runtime fallback.

The runtime polymorphic surface (IChannel, ChannelEvents callbacks, the ChannelManager registry) is unchanged – Channel<B, Chipset>::create() returns a ChannelPtr (shared_ptr to the existing non-template Channel) so everything downstream continues to see one channel type.

Definition in file channel_typed.h.

+ Include dependency graph for channel_typed.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  fl::detail::resolve_bus< B, Chipset >
 Resolve a possibly-Bus::AUTO template argument to the concrete platform default for the given Chipset family. More...
 
struct  fl::detail::resolve_bus< Bus::AUTO, Chipset >
 
class  fl::TypedChannel< B, Chipset >
 Templated channel facade. More...
 

Namespaces

namespace  fl
 Base definition for an LED controller.
 
namespace  fl::detail
 Compile-time linker keep-alive hook for a single fl::Bus.