]> granicus.if.org Git - esp-idf/commitdiff
sdmmc: use periph_ctrl to enable peripheral when initializing the host
authorIvan Grokhotkov <ivan@espressif.com>
Mon, 4 Sep 2017 10:12:46 +0000 (18:12 +0800)
committerIvan Grokhotkov <ivan@espressif.com>
Mon, 4 Sep 2017 14:43:52 +0000 (22:43 +0800)
components/driver/sdmmc_host.c

index 2ef7b2e0cf2d2ea1acaa5ae0c5c67a09675332fc..e233df0a5ddf0e762e10cdc2cbb630e31ba346b0 100644 (file)
@@ -24,6 +24,7 @@
 #include "rom/gpio.h"
 #include "driver/gpio.h"
 #include "driver/sdmmc_host.h"
+#include "driver/periph_ctrl.h"
 #include "sdmmc_private.h"
 
 #define SDMMC_EVENT_QUEUE_LENGTH 32
@@ -236,6 +237,8 @@ esp_err_t sdmmc_host_init()
         return ESP_ERR_INVALID_STATE;
     }
 
+    periph_module_enable(PERIPH_SDMMC_MODULE);
+
     // Enable clock to peripheral
     sdmmc_host_input_clk_enable();
 
@@ -367,6 +370,7 @@ esp_err_t sdmmc_host_deinit()
     s_event_queue = NULL;
     sdmmc_host_input_clk_disable();
     sdmmc_host_transaction_handler_deinit();
+    periph_module_disable(PERIPH_SDMMC_MODULE);
     return ESP_OK;
 }