From e12971b9711d32871b58386ee80d8e6b0e521b06 Mon Sep 17 00:00:00 2001 From: Marcel Peterkau Date: Wed, 24 Aug 2022 23:08:57 +0200 Subject: [PATCH] some debugging --- Software/src/main.cpp | 21 +++++++++++++++++++-- Software/src/rmtdbghelp.h | 3 ++- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/Software/src/main.cpp b/Software/src/main.cpp index a5beccb..ffb1f5c 100644 --- a/Software/src/main.cpp +++ b/Software/src/main.cpp @@ -77,6 +77,7 @@ void RemoteDebug_CheckEEPOM(); void RemoteDebug_dumpConfig(); void RemoteDebug_dumpPersistance(); void RemoteDebug_ShowDTCs(); +void RemoteDebug_dumpGlobals(); #endif #ifdef FEATURE_ENABLE_WIFI_CLIENT @@ -287,9 +288,11 @@ void processCmdRemoteDebug() else if (lastCmd == "dumpPDS") RemoteDebug_dumpPersistance(); else if (lastCmd == "saveEE") - globals.requestEEAction == EE_ALL_SAVE; + globals.requestEEAction = EE_ALL_SAVE; else if (lastCmd == "showdtc") RemoteDebug_ShowDTCs(); + else if (lastCmd == "dumpGlobals") + RemoteDebug_dumpGlobals(); } void RemoteDebug_formatCFG() @@ -350,6 +353,20 @@ void RemoteDebug_dumpConfig() 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() { debugA("writeCycleCounter: %d", PersistenceData.writeCycleCounter); @@ -748,7 +765,7 @@ void SystemShutdown() if (shutdown_delay == 0) { 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()) { diff --git a/Software/src/rmtdbghelp.h b/Software/src/rmtdbghelp.h index b02053c..a7159fa 100644 --- a/Software/src/rmtdbghelp.h +++ b/Software/src/rmtdbghelp.h @@ -9,4 +9,5 @@ const char helpCmd[] = "sysinfo - System Info\r\n" "dumpCFG - print Config struct\r\n" "dumpPDS - print PersistanceStruct\r\n" "saveEE - save EE-Data\r\n" - "showdtc - Show all DTCs\r\n"; \ No newline at end of file + "showdtc - Show all DTCs\r\n" + "dumpGlobals - print globals\r\n"; \ No newline at end of file