test
This commit is contained in:
parent
d31492a0de
commit
b4196e696c
20
src/main.cpp
20
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);
|
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,22 +313,22 @@ 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";
|
||||||
|
|
Loading…
Reference in a new issue