From 15ca3614bafb664e57715b6f214cbbc927f23e1d Mon Sep 17 00:00:00 2001 From: Thomas Hooge Date: Tue, 12 Aug 2025 13:29:36 +0200 Subject: [PATCH] Include uptime in system page --- lib/obp60task/PageSystem.cpp | 23 +++++++++++++++++++++++ platformio.ini | 2 +- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/lib/obp60task/PageSystem.cpp b/lib/obp60task/PageSystem.cpp index 8df57e5..fb40207 100644 --- a/lib/obp60task/PageSystem.cpp +++ b/lib/obp60task/PageSystem.cpp @@ -192,6 +192,29 @@ private: } #endif + // Uptime + int64_t uptime = esp_timer_get_time() / 1000000; + String uptime_unit; + if (uptime < 120) { + uptime_unit = " seconds"; + } else { + if (uptime < 2 * 3600) { + uptime /= 60; + uptime_unit = " minutes"; + } else if (uptime < 2 * 3600 * 24) { + uptime /= 3600; + uptime_unit = " hours"; + } else { + uptime /= 86400; + uptime_unit = " days"; + } + } + epd->setCursor(8, y0 + 80); + epd->print("Uptime:"); + epd->setCursor(90, y0 + 80); + epd->print(uptime); + epd->print(uptime_unit); + // CPU speed config / active epd->setCursor(202, y0); epd->print("CPU speed:"); diff --git a/platformio.ini b/platformio.ini index 927eb9e..32b9902 100644 --- a/platformio.ini +++ b/platformio.ini @@ -30,7 +30,7 @@ lib_deps = Update [env] -platform = espressif32 @ 6.9.0 +platform = espressif32 @ 6.11.0 framework = arduino ;platform_packages= ; framework-arduinoespressif32 @ 3.20017.0