Skip to content

Commit

Permalink
About SD card, now the default CS pin is the default SS depending on …
Browse files Browse the repository at this point in the history
…your target board. Minor code style refactor

Signed-off-by: Fabiano Riccardi <[email protected]>
  • Loading branch information
Fabiano Riccardi committed Nov 10, 2018
1 parent 36e6904 commit b53b0e9
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 13 deletions.
4 changes: 3 additions & 1 deletion src/logger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,6 @@ Logger::Logger(String file, int debugVerbosity):
return true;
})
{
};
};

Logger::~Logger(){}
4 changes: 3 additions & 1 deletion src/logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
class Logger{
public:

Logger(String file, int debugVerbosity);
Logger(String file, int debugVerbosity = 1);

/**
* Activate the Filesystem, call before starting to append or flush,
Expand Down Expand Up @@ -96,6 +96,8 @@ class Logger{
* Get maximum log dimension
*/
unsigned int getSizeLimit();

virtual ~Logger();

protected:
String filePath;
Expand Down
10 changes: 1 addition & 9 deletions src/logger_sd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,15 +289,7 @@ LoggerSD::LoggerSD(String file, int debugVerbosity): Logger(file,debugVerbosity)
};

bool LoggerSD::begin(){
#ifdef ESP8266
if (debugVerbosity>1) Serial.println("[ESP LOGGER] On ESP8266 this is not implemented, because multiple init are going to fail..");
return false;
#endif
if(!SD.begin(16)){
if (debugVerbosity>1) Serial.println("[ESP LOGGER] Card Mount Failed");
return false;
}
return true;
return begin(SS);
}

bool LoggerSD::begin(int csPin){
Expand Down
2 changes: 1 addition & 1 deletion src/logger_sd.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class LoggerSD : public Logger{
bool begin();
bool begin(int csPin);

bool append(String message, bool timestamp=true);
bool append(String message, bool timestamp = true);

void reset();

Expand Down
2 changes: 1 addition & 1 deletion src/logger_spiffs.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class LoggerSPIFFS : public Logger{

bool begin();

bool append(String message, bool timestamp=true);
bool append(String message, bool timestamp = true);

void reset();

Expand Down

0 comments on commit b53b0e9

Please sign in to comment.