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); File file = fs.open(path, FILE_WRITE);
if(!file){ if(!file){
Serial.println("Failed to open file for writing"); Serial.println("Failed to open file for writing");
//errorCode(2); errorCode(2);
return; return;
} }
if(file.print(message)){ if(file.print(message)){
@ -313,23 +313,23 @@ 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){
Serial.println("No SD card attached"); Serial.println("No SD card attached");
//errorCode(4); errorCode(4);
return; return;
} }
uint64_t cardSize = SD.cardSize() / (1024 * 1024);
if(!SD.begin()){ Serial.printf("SD Card Size: %lluMB\n", cardSize);
Serial.println("Card Mount Failed");
//errorCode(3);
return;
}
now = rtc.now(); now = rtc.now();
char date_format[] = "DDhhmm"; char date_format[] = "DDhhmm";
char *date = now.toString(date_format); char *date = now.toString(date_format);