some debugging

This commit is contained in:
Marcel Peterkau 2022-08-24 23:08:57 +02:00
parent 4f5fdb7af4
commit e12971b971
2 changed files with 21 additions and 3 deletions

View File

@ -77,6 +77,7 @@ void RemoteDebug_CheckEEPOM();
void RemoteDebug_dumpConfig(); void RemoteDebug_dumpConfig();
void RemoteDebug_dumpPersistance(); void RemoteDebug_dumpPersistance();
void RemoteDebug_ShowDTCs(); void RemoteDebug_ShowDTCs();
void RemoteDebug_dumpGlobals();
#endif #endif
#ifdef FEATURE_ENABLE_WIFI_CLIENT #ifdef FEATURE_ENABLE_WIFI_CLIENT
@ -287,9 +288,11 @@ void processCmdRemoteDebug()
else if (lastCmd == "dumpPDS") else if (lastCmd == "dumpPDS")
RemoteDebug_dumpPersistance(); RemoteDebug_dumpPersistance();
else if (lastCmd == "saveEE") else if (lastCmd == "saveEE")
globals.requestEEAction == EE_ALL_SAVE; globals.requestEEAction = EE_ALL_SAVE;
else if (lastCmd == "showdtc") else if (lastCmd == "showdtc")
RemoteDebug_ShowDTCs(); RemoteDebug_ShowDTCs();
else if (lastCmd == "dumpGlobals")
RemoteDebug_dumpGlobals();
} }
void RemoteDebug_formatCFG() void RemoteDebug_formatCFG()
@ -350,6 +353,20 @@ void RemoteDebug_dumpConfig()
debugA("checksum: 0x%08X", LubeConfig.checksum); debugA("checksum: 0x%08X", LubeConfig.checksum);
} }
void RemoteDebug_dumpGlobals()
{
debugA("systemStatus: %d", globals.systemStatus);
debugA("resumeStatus: %d", globals.resumeStatus);
debugA("systemStatustxt: %s", globals.systemStatustxt);
debugA("purgePulses: %d", globals.purgePulses);
debugA("requestEEAction: %d", globals.requestEEAction);
debugA("DeviceName: %s", globals.DeviceName);
debugA("FlashVersion: %s", globals.FlashVersion);
debugA("eePersistanceAdress: %d", globals.eePersistanceAdress);
debugA("TankPercentage: %d", globals.TankPercentage);
debugA("hasDTC: %d", globals.hasDTC);
}
void RemoteDebug_dumpPersistance() void RemoteDebug_dumpPersistance()
{ {
debugA("writeCycleCounter: %d", PersistenceData.writeCycleCounter); debugA("writeCycleCounter: %d", PersistenceData.writeCycleCounter);
@ -748,7 +765,7 @@ void SystemShutdown()
if (shutdown_delay == 0) if (shutdown_delay == 0)
{ {
shutdown_delay = millis() + SHUTDOWN_DELAY_MS; shutdown_delay = millis() + SHUTDOWN_DELAY_MS;
Serial.printf("Shutdown requested - Restarting in %d seconds\n", SHUTDOWN_DELAY_MS/1000); Serial.printf("Shutdown requested - Restarting in %d seconds\n", SHUTDOWN_DELAY_MS / 1000);
} }
if (shutdown_delay < millis()) if (shutdown_delay < millis())
{ {

View File

@ -9,4 +9,5 @@ const char helpCmd[] = "sysinfo - System Info\r\n"
"dumpCFG - print Config struct\r\n" "dumpCFG - print Config struct\r\n"
"dumpPDS - print PersistanceStruct\r\n" "dumpPDS - print PersistanceStruct\r\n"
"saveEE - save EE-Data\r\n" "saveEE - save EE-Data\r\n"
"showdtc - Show all DTCs\r\n"; "showdtc - Show all DTCs\r\n"
"dumpGlobals - print globals\r\n";