FastLED 3.10.10
Loading...
Searching...
No Matches

◆ ~SpiChannelEngineAdapter()

fl::SpiChannelEngineAdapter::~SpiChannelEngineAdapter ( )
override

Destructor.

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

71 {
72 FL_DBG("SpiChannelEngineAdapter: Destructor for '" << mName << "'");
73
74 // Clear any enqueued channels that were never transmitted
75 // This prevents infinite loop in poll() which returns DRAINING if enqueued channels exist
76 mEnqueuedChannels.clear();
77
78 // Poll until READY to ensure cleanup of any in-flight transmissions
79 while (poll() != DriverState::READY) {
80 // Busy-wait for transmission completion
81 // This is acceptable in destructor context
82 }
83
84 // Shutdown all initialized controllers
85 for (auto& ctrl : mControllers) {
86 if (ctrl.controller && ctrl.controller->isInitialized()) {
87 ctrl.controller->end();
88 }
89 if (ctrl.controller) ctrl.controller->setStreamCompletionCallback(nullptr, nullptr);
90 }
91}
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: