/*
Example calls:
printProjectInfos();
printProjectInfos("1.4.6 #00548");
*/
void printProjectInfos(char * AppVersion = nullptr) {
int monthNo, day, year, h, m, s;
char monthShort[4];
const char month_names[] = "JanFebMarAprMayJunJulAugSepOctNovDec";
sscanf(__DATE__, "%s %d %d", monthShort, &day, &year);
sscanf(__TIME__, "%02d:%02d:%02d", &h, &m, &s);
// monthNo = (strstr(month_names, monthShort)-month_names)/3+1;
Serial.println("----------------------------------------------------------------");
Serial.printf("Program Version: %s\n", AppVersion ? AppVersion : "unknown");
size_t sl = strlen(__BASE_FILE__);
Serial.print("Sourcefile: '");
// Remove the extra extension '.cpp' from the basename
// __BASE_FILE__ returns somthing like: 'C:/Arduino/sketch/MyProgramm.ino.cpp'
for (int i=0; i < sl-4; i++) Serial.print(__BASE_FILE__[i]);
Serial.println("'");
Serial.printf("Compiled: %02d.%s.%d %02d:%02d\n", day, monthShort, year, h, m);
Serial.println("----------------------------------------------------------------");
}
void setup() {
Serial.begin(115200);
printProjectInfos();
printProjectInfos("1.4.6 #00548");
}
void loop() {
// put your main code here, to run repeatedly:
delay(1000); // this speeds up the simulation
}