Set SD state to idle before unregister (reduces power) (#4272)

This commit is contained in:
lbernstone 2020-10-01 06:31:16 -06:00 committed by GitHub
parent f98fc7ee9f
commit 99c94bb482
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;