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

Method freeBus

src/platforms/esp/32/drivers/spi/spi_peripheral_esp.cpp.hpp:227–249  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

225}
226
227bool SpiPeripheralESPImpl::freeBus() FL_NOEXCEPT {
228 if (!mBusInitialized) {
229 FL_WARN("SpiPeripheralESP: Bus not initialized");
230 return false;
231 }
232
233 if (mDeviceAdded) {
234 FL_WARN("SpiPeripheralESP: Cannot free bus - device still attached");
235 return false;
236 }
237
238 // Free bus resources (delegate to ESP-IDF)
239 esp_err_t err = ::spi_bus_free(mHost);
240 if (err != ESP_OK) {
241 FL_WARN("SpiPeripheralESP: Failed to free bus: " << err);
242 return false;
243 }
244
245 mBusInitialized = false;
246 FL_DBG("SpiPeripheralESP: Bus freed");
247
248 return true;
249}
250
251bool SpiPeripheralESPImpl::isInitialized() const FL_NOEXCEPT {
252 return mBusInitialized && mDeviceAdded;

Callers 2

~SpiPeripheralFixtureMethod · 0.45
FL_TEST_FILEFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected