From b4196e696c01adedb29cb389347367ed45d061c9 Mon Sep 17 00:00:00 2001 From: pgp Date: Fri, 16 Apr 2021 10:46:53 +0200 Subject: [PATCH] test --- src/main.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 2b7b308..01879be 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -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);