mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
d35239dd28
If for example there are still devices configured on the bus spi_bus_free() will report that with ESP_ERR_INVALID_STATE, but not before it frees all other things like IO and DMA. This means that after the function exits any other task that is still running and using those devices will all of a sudden stop working (and probably crash the device). This commit prevents that situation by making the function return early so it can be called again safely later when all devices have been removed. Closes https://github.com/espressif/esp-idf/pull/13856