MCPcopy Create free account
hub / github.com/FastLED/FastLED / busName

Function busName

src/fl/channels/bus.h:167–186  ·  view source on GitHub ↗

@brief Canonical driver-name string for a `Bus` value. Each `Bus::X` corresponds to exactly one concrete `IChannelDriver`. That driver's `getName()` returns a stable string that `ChannelManager` uses as the lookup key (`findDriverByName` / `getDriverByName`). Channels read `ChannelOptions::mBus` (#2459) and the dispatch layer derives the lookup string via `busName(mBus)` — typo-prone string liter

Source from the content-addressed store, hash-verified

165/// **Lifetime.** Every returned pointer is to a string literal, so it has
166/// static storage duration — safe to feed to `fl::string::from_literal()`.
167inline const char* busName(Bus b) FL_NOEXCEPT {
168 switch (b) {
169 case Bus::AUTO: return "AUTO";
170 case Bus::RMT: return "RMT";
171 case Bus::PARLIO: return "PARLIO";
172 case Bus::SPI: return "SPI";
173 case Bus::I2S: return "I2S";
174 case Bus::I2S_SPI: return "I2S_SPI";
175 case Bus::LCD_RGB: return "LCD_RGB";
176 case Bus::LCD_SPI: return "LCD_SPI";
177 case Bus::LCD_CLOCKLESS: return "LCD_CLOCKLESS";
178 case Bus::UART: return "UART";
179 case Bus::FLEX_IO: return "FLEX_IO";
180 case Bus::OBJECT_FLED: return "OBJECT_FLED";
181 case Bus::LPUART: return "LPUART";
182 case Bus::BIT_BANG: return "BIT_BANG";
183 case Bus::STUB: return "STUB";
184 }
185 return ""; // unreachable — silences -Wreturn-type on toolchains that miss the exhaustive switch
186}
187
188// Drift-prevention: if a new `Bus` enumerator is added, the switch above must
189// gain a case. Update this assertion to the new last enumerator after you

Callers 2

resolveDynamicDriverMethod · 0.85
setExclusiveDriverMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected