| 225 | } |
| 226 | |
| 227 | bool 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 | |
| 251 | bool SpiPeripheralESPImpl::isInitialized() const FL_NOEXCEPT { |
| 252 | return mBusInitialized && mDeviceAdded; |
no outgoing calls
no test coverage detected