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

Method setExclusiveDriverByName

src/fl/channels/manager.cpp.hpp:248–274  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

246}
247
248bool ChannelManager::setExclusiveDriverByName(const char* name) {
249 // Handle null or empty name: disable everything.
250 if (!name || !name[0]) {
251 FL_ERROR("ChannelManager::setExclusiveDriverByName() - Null or empty driver name provided");
252 mExclusiveDriver.clear();
253 for (auto& entry : mDrivers) {
254 entry.enabled = false;
255 }
256 return false;
257 }
258
259 // Store exclusive driver name for forward compatibility.
260 // When non-empty, addDriver() will auto-disable non-matching drivers.
261 mExclusiveDriver = name;
262
263 // Single-pass: enable only drivers matching the given name.
264 bool found = false;
265 for (auto& entry : mDrivers) {
266 entry.enabled = (entry.name == name);
267 found = found || entry.enabled;
268 }
269
270 if (!found) {
271 FL_ERROR("ChannelManager::setExclusiveDriverByName() - Driver '" << name << "' not found in registry");
272 }
273 return found;
274}
275
276bool ChannelManager::setDriverPriority(const fl::string& name, int priority) {
277 if (name.empty()) {

Callers 4

FL_TEST_FILEFunction · 0.80
channel.cppFile · 0.80
testSingleDriverMethod · 0.80

Calls 1

clearMethod · 0.45

Tested by 1

testSingleDriverMethod · 0.64