Fix SD issue on failed mount

fixes: https://github.com/espressif/arduino-esp32/issues/613
This commit is contained in:
me-no-dev 2017-11-06 16:13:09 +02:00
parent 14dd44ad06
commit 45d5d9b360

View File

@ -36,6 +36,7 @@ bool SDFS::begin(uint8_t ssPin, SPIClass &spi, uint32_t frequency, const char *
} }
if(!sdcard_mount(_pdrv, mountpoint)){ if(!sdcard_mount(_pdrv, mountpoint)){
sdcard_unmount(_pdrv);
sdcard_uninit(_pdrv); sdcard_uninit(_pdrv);
_pdrv = 0xFF; _pdrv = 0xFF;
return false; return false;