This commit is contained in:
pgp 2021-04-16 10:46:53 +02:00
parent d31492a0de
commit b4196e696c

View file

@ -233,7 +233,7 @@ void writeFile(fs::FS &fs, const char * path, const char * message){
File file = fs.open(path, FILE_WRITE);
if(!file){
Serial.println("Failed to open file for writing");
//errorCode(2);
errorCode(2);
return;
}
if(file.print(message)){
@ -313,23 +313,23 @@ void testFileIO(fs::FS &fs, const char * path){
void sd_init() {
if(!SD.begin()){
Serial.println("Card Mount Failed");
errorCode(3);
return;
}
uint8_t cardType = SD.cardType();
if(cardType == CARD_NONE){
Serial.println("No SD card attached");
//errorCode(4);
errorCode(4);
return;
}
if(!SD.begin()){
Serial.println("Card Mount Failed");
//errorCode(3);
return;
}
uint64_t cardSize = SD.cardSize() / (1024 * 1024);
Serial.printf("SD Card Size: %lluMB\n", cardSize);
now = rtc.now();
char date_format[] = "DDhhmm";
char *date = now.toString(date_format);