Added sdcard not present check

This commit is contained in:
blckmn 2016-07-13 19:39:03 +10:00
parent 4e894cc90f
commit 7ca18b52ca
1 changed files with 5 additions and 0 deletions

View File

@ -192,6 +192,11 @@ static void sdcard_deselect(void)
*/
static void sdcard_reset(void)
{
if (!sdcard_isInserted()) {
sdcard.state = SDCARD_STATE_NOT_PRESENT;
return;
}
if (sdcard.state >= SDCARD_STATE_READY) {
spiSetDivisor(SDCARD_SPI_INSTANCE, SDCARD_SPI_INITIALIZATION_CLOCK_DIVIDER);
}