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

◆ ~SpiChannelEngineAdapter()

fl::SpiChannelEngineAdapter::~SpiChannelEngineAdapter ( )
override

Destructor.

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

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

References FL_DBG, FL_NOEXCEPT, mControllers, mEnqueuedChannels, mName, and poll().

+ Here is the call graph for this function: