From d5508137d31d6efe80dd127cc15f6b03e9d5b2d4 Mon Sep 17 00:00:00 2001 From: Marcel Peterkau Date: Fri, 6 May 2022 22:35:44 +0200 Subject: [PATCH] some Info avout FW-Version added to WebUI --- Software/ChainLube/data/index.htm | 18 ++++++++++++++++++ Software/ChainLube/src/common.h | 3 +++ Software/ChainLube/src/webui.cpp | 8 ++++++++ Software/ChainLube/src/webui.h | 1 + 4 files changed, 30 insertions(+) diff --git a/Software/ChainLube/data/index.htm b/Software/ChainLube/data/index.htm index 48e9237..9b81571 100644 --- a/Software/ChainLube/data/index.htm +++ b/Software/ChainLube/data/index.htm @@ -341,6 +341,20 @@

Systeminfo


+

Firmware-Info

+

+ + + + + + + + +
Parameter + Value +
Version%SW_VERSION%
+

Einstellungen

@@ -424,6 +438,10 @@ + + + + diff --git a/Software/ChainLube/src/common.h b/Software/ChainLube/src/common.h index a57e072..c6bbf72 100644 --- a/Software/ChainLube/src/common.h +++ b/Software/ChainLube/src/common.h @@ -14,6 +14,9 @@ #define HOST_NAME "ChainLube_%06X" // Use printf-Formatting - Chip-ID (uin32_t) will be added #endif +#define SW_VERSION_MAJOR 1 +#define SW_VERSION_MINOR 0 + #ifndef OTA_DELAY #define OTA_DELAY 50 // ticks -> 10ms / tick #endif diff --git a/Software/ChainLube/src/webui.cpp b/Software/ChainLube/src/webui.cpp index 18a5df1..ac42c37 100644 --- a/Software/ChainLube/src/webui.cpp +++ b/Software/ChainLube/src/webui.cpp @@ -71,6 +71,8 @@ String processor(const String &var) } if (var == "WRITE_CYCLE_COUNT") return String(PersistenceData.writeCycleCounter); + if (var == "PERSISTENCE_MARKER") + return String(getPersistanceAddress()); if (var == "TANK_REMAIN_UL") return String(PersistenceData.tankRemain_µl); if (var == "TRAVEL_DISTANCE_HIGHRES") @@ -168,6 +170,12 @@ String processor(const String &var) if (var == "SYSTEM_STATUS") return String(globals.systemStatustxt); + if (var == "SW_VERSION") + { + char buffer[7]; + sprintf(buffer, "%d.%02d", SW_VERSION_MAJOR, SW_VERSION_MINOR); + return String(buffer); + } if (var == "PLACEHOLDER") return "placeholder"; diff --git a/Software/ChainLube/src/webui.h b/Software/ChainLube/src/webui.h index af82387..55d57a5 100644 --- a/Software/ChainLube/src/webui.h +++ b/Software/ChainLube/src/webui.h @@ -9,6 +9,7 @@ #include "config.h" #include "globals.h" #include "dtc.h" +#include "common.h" void initWebUI();
writeCycleCounter %WRITE_CYCLE_COUNT%
PersistenceMarker%PERSISTENCE_MARKER%
tankRemain_µl %TANK_REMAIN_UL%