From 99c94bb4829467ab3c4b20c03868a43b8a1fa317 Mon Sep 17 00:00:00 2001 From: lbernstone Date: Thu, 1 Oct 2020 06:31:16 -0600 Subject: [PATCH] Set SD state to idle before unregister (reduces power) (#4272) --- libraries/SD/src/sd_diskio.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/libraries/SD/src/sd_diskio.cpp b/libraries/SD/src/sd_diskio.cpp index 0a9c86cc..fea10fcb 100644 --- a/libraries/SD/src/sd_diskio.cpp +++ b/libraries/SD/src/sd_diskio.cpp @@ -648,6 +648,7 @@ uint8_t sdcard_uninit(uint8_t pdrv) if (pdrv >= FF_VOLUMES || card == NULL) { return 1; } + sdTransaction(pdrv, GO_IDLE_STATE, 0, NULL); ff_diskio_register(pdrv, NULL); s_cards[pdrv] = NULL; esp_err_t err = ESP_OK;