]> granicus.if.org Git - esp-idf/commitdiff
fix(spi_slave): add interrupt free into bus free process.
authormichael <xiaoxufeng@espressif.com>
Sat, 30 Sep 2017 10:26:55 +0000 (18:26 +0800)
committermichael <xiaoxufeng@espressif.com>
Fri, 17 Nov 2017 04:14:40 +0000 (12:14 +0800)
components/driver/spi_slave.c

index bfc700cea70fe69bee0d228cccae6d72d11324aa..c65cb3b52adda6df8ba021d6e9f3b8dc7b13d441 100644 (file)
@@ -222,6 +222,7 @@ esp_err_t spi_slave_free(spi_host_device_t host)
     }
     free(spihost[host]->dmadesc_tx);
     free(spihost[host]->dmadesc_rx);
+    esp_intr_free(spihost[host]->intr);
 #ifdef CONFIG_PM_ENABLE
     esp_pm_lock_release(spihost[host]->pm_lock);
     esp_pm_lock_delete(spihost[host]->pm_lock);
@@ -229,7 +230,6 @@ esp_err_t spi_slave_free(spi_host_device_t host)
     free(spihost[host]);
     spihost[host] = NULL;
     spicommon_periph_free(host);
-    spihost[host] = NULL;
     return ESP_OK;
 }