FastLED 3.10.8
Loading...
Searching...
No Matches

◆ ~SpiChannelEngineAdapter()

fl::SpiChannelEngineAdapter::~SpiChannelEngineAdapter ( )
override

Destructor.

Definition at line 68 of file spi_channel_adapter.cpp.hpp.

68 {
69 FL_DBG("SpiChannelEngineAdapter: Destructor for '" << mName << "'");
70
71 // Clear any enqueued channels that were never transmitted
72 // This prevents infinite loop in poll() which returns DRAINING if enqueued channels exist
73 mEnqueuedChannels.clear();
74
75 // Poll until READY to ensure cleanup of any in-flight transmissions
76 while (poll() != DriverState::READY) {
77 // Busy-wait for transmission completion
78 // This is acceptable in destructor context
79 }
80
81 // Shutdown all initialized controllers
82 for (auto& ctrl : mControllers) {
83 if (ctrl.controller && ctrl.controller->isInitialized()) {
84 ctrl.controller->end();
85 }
86 }
87}
fl::string mName
Engine name for debugging.
fl::vector< ControllerInfo > mControllers
All managed controllers.
DriverState poll() FL_NO_EXCEPT override
Query driver state and perform maintenance.
fl::vector< ChannelDataPtr > mEnqueuedChannels
Channels waiting for show()
#define FL_DBG
Definition log.h:553

References FL_DBG, fl::FL_NO_EXCEPT, mControllers, mEnqueuedChannels, mName, and poll().

+ Here is the call graph for this function: