FastLED 3.9.15
Loading...
Searching...
No Matches

◆ clearAllDrivers()

void fl::ChannelManager::clearAllDrivers ( )

Remove all drivers from the manager.

Note
Clears the entire driver registry
Useful for FastLED.reset() with CHANNEL_DRIVERS flag
Waits for all drivers to become READY before clearing (1 second timeout)

Definition at line 205 of file manager.cpp.hpp.

205 {
206 FL_DBG("ChannelManager: Waiting for all drivers to become READY before clearing");
207
208 // Wait for all drivers to become READY before clearing
209 // This prevents clearing drivers that are still transmitting
210 waitForReady();
211
212 FL_DBG("ChannelManager: Clearing " << mDrivers.size() << " drivers");
213
214 for (auto& entry : mDrivers) {
215 if (entry.driver) {
216 entry.driver->setPollNeededCallback(IChannelDriver::PollNeededCallback());
217 }
218 }
219
220 // Clear all drivers (shared_ptr handles cleanup automatically)
221 mDrivers.clear();
222}
bool waitForReady(u32 timeoutMs=1000) FL_NOEXCEPT
Wait for all drivers to become READY.
fl::vector< EngineEntry > mDrivers
Shared drivers sorted by priority descending (higher values first)
Definition manager.h:287
#define FL_DBG
Definition log.h:388

References FL_DBG, mDrivers, and waitForReady().

Referenced by CFastLED::clear().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: