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

Method setDriverPriority

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

Source from the content-addressed store, hash-verified

274}
275
276bool ChannelManager::setDriverPriority(const fl::string& name, int priority) {
277 if (name.empty()) {
278 FL_ERROR("ChannelManager::setDriverPriority() - Empty driver name provided");
279 return false;
280 }
281
282 // Find driver and update priority
283 bool found = false;
284 for (auto& entry : mDrivers) {
285 if (entry.name == name) {
286 entry.priority = priority;
287 found = true;
288 FL_DBG("ChannelManager: Driver '" << name << "' priority changed to " << priority);
289 break;
290 }
291 }
292
293 if (!found) {
294 FL_ERROR("ChannelManager::setDriverPriority() - Driver '" << name << "' not found in registry");
295 return false;
296 }
297
298 // Re-sort drivers by priority (descending: higher values first).
299 // 1-4 drivers expected here too — sort_small avoids the quicksort body.
300 fl::sort_small(mDrivers.begin(), mDrivers.end());
301
302 FL_DBG("ChannelManager: Engine list re-sorted after priority change");
303 return true;
304}
305
306bool ChannelManager::isDriverEnabled(const char* name) const {
307 if (!name) {

Callers 1

FL_TEST_FILEFunction · 0.80

Calls 4

sort_smallFunction · 0.85
emptyMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected