inversion des fonctions erreur SD card
This commit is contained in:
parent
b9fb098576
commit
657a6b1eb0
15
src/main.cpp
15
src/main.cpp
|
@ -372,19 +372,22 @@ void testFileIO(fs::FS &fs, const char * path){
|
||||||
|
|
||||||
void sd_init() {
|
void sd_init() {
|
||||||
|
|
||||||
|
uint8_t cardType = SD.cardType();
|
||||||
|
|
||||||
|
if(cardType == CARD_NONE){
|
||||||
|
Serial.println("No SD card attached");
|
||||||
|
errorCode(4);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if(!SD.begin()){
|
if(!SD.begin()){
|
||||||
Serial.println("Card Mount Failed");
|
Serial.println("Card Mount Failed");
|
||||||
errorCode(3);
|
errorCode(3);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t cardType = SD.cardType();
|
|
||||||
|
|
||||||
if(cardType == CARD_NONE){
|
|
||||||
Serial.println("No SD card attached");
|
|
||||||
errorCode(4);
|
|
||||||
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);
|
||||||
|
|
Loading…
Reference in a new issue