Currently, i have this code:
void writeLog(__FlashStringHelper* mes){
Serial.println(mes);
if(!logfile){
logfile = SD.open(logpath,FILE_WRITE);
if(!logfile) return;
}
logfile.write(mes);
}
void writeLog(char* mes){
Serial.println(mes);
if(!logfile){
logfile = SD.open(logpath,FILE_WRITE);
if(!logfile) return;
}
logfile.write(mes);
}
Is there a way to overload a function to accept char* and __FlashStringHelper* without writing the body 2 times?
Thanks!