inversion des fonctions erreur SD card

This commit is contained in:
pgp 2021-07-01 14:27:05 +02:00
parent b9fb098576
commit 657a6b1eb0

View file

@ -372,12 +372,6 @@ void testFileIO(fs::FS &fs, const char * path){
void sd_init() { void sd_init() {
if(!SD.begin()){
Serial.println("Card Mount Failed");
errorCode(3);
return;
}
uint8_t cardType = SD.cardType(); uint8_t cardType = SD.cardType();
if(cardType == CARD_NONE){ if(cardType == CARD_NONE){
@ -386,6 +380,15 @@ void sd_init() {
return; return;
} }
if(!SD.begin()){
Serial.println("Card Mount Failed");
errorCode(3);
return;
}
uint64_t cardSize = SD.cardSize() / (1024 * 1024); uint64_t cardSize = SD.cardSize() / (1024 * 1024);
Serial.printf("SD Card Size: %lluMB\n", cardSize); Serial.printf("SD Card Size: %lluMB\n", cardSize);