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

Method end

src/fl/channels/spi/device.cpp.hpp:127–150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

125}
126
127void Device::end() {
128 if (!pImpl || !pImpl->initialized) {
129 return;
130 }
131
132 // Wait for any pending operations
133 waitComplete();
134
135 // Note: Do NOT call hw->end() here!
136 // The SPIBusManager will call releaseBusHardware() (which calls hw->end())
137 // when the last device on this bus is unregistered below.
138 // Calling hw->end() here would result in calling end() twice on the same hardware.
139 pImpl->hw_backend = nullptr;
140
141 // Unregister from bus manager
142 if (pImpl->bus_handle.is_valid) {
143 SPIBusManager& mgr = getSPIBusManager();
144 mgr.unregisterDevice(pImpl->bus_handle);
145 pImpl->bus_handle = SPIBusHandle();
146 }
147
148 pImpl->initialized = false;
149 FL_LOG_SPI("SPI Device: Shutdown complete");
150}
151
152bool Device::isReady() const {
153 return pImpl && pImpl->initialized;

Callers 7

MultiChannelConfigMethod · 0.45
addDriverMethod · 0.45
setDriverPriorityMethod · 0.45
getOrCreateIdMethod · 0.45
getIdMethod · 0.45
device.cpp.hppFile · 0.45

Calls 2

SPIBusHandleClass · 0.85
unregisterDeviceMethod · 0.80

Tested by

no test coverage detected