From a42d31ff49744d1a7b02a7b8801f907e88bc5d88 Mon Sep 17 00:00:00 2001 From: Thomas Hooge Date: Wed, 22 Jan 2025 20:14:55 +0100 Subject: [PATCH] System page inprovements, e.g. soft reset --- lib/obp60task/PageSystem.cpp | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/lib/obp60task/PageSystem.cpp b/lib/obp60task/PageSystem.cpp index 7beb13d..58d3788 100644 --- a/lib/obp60task/PageSystem.cpp +++ b/lib/obp60task/PageSystem.cpp @@ -48,7 +48,7 @@ public: commonData->keydata[0].label = "EXIT"; commonData->keydata[1].label = "MODE"; commonData->keydata[2].label = ""; - commonData->keydata[3].label = ""; + commonData->keydata[3].label = "RST"; commonData->keydata[4].label = "STBY"; commonData->keydata[5].label = "ILUM"; } @@ -67,9 +67,13 @@ public: return 0; } // grab cursor keys to disable page navigation - if (key == 3 or key == 4) { + if (key == 3) { return 0; } + // soft reset + if (key == 4) { + ESP.restart(); + } // Code for keylock if (key == 11) { commonData->keylock = !commonData->keylock; @@ -133,11 +137,25 @@ public: getdisplay().setCursor(120, y0 + 16); getdisplay().print(env_module); + // total RAM free + int Heap_free = esp_get_free_heap_size(); + getdisplay().setCursor(202, y0 + 16); + getdisplay().print("Total free:"); + getdisplay().setCursor(300, y0 + 16); + getdisplay().print(String(Heap_free)); + getdisplay().setCursor(2, y0 + 32); getdisplay().print("Buzzer:"); getdisplay().setCursor(120, y0 + 32); getdisplay().print(buzzer_mode); + // RAM free for task + int RAM_free = uxTaskGetStackHighWaterMark(NULL); + getdisplay().setCursor(202, y0 + 32); + getdisplay().print("Task free:"); + getdisplay().setCursor(300, y0 + 32); + getdisplay().print(String(RAM_free)); + getdisplay().setCursor(2, y0 + 48); getdisplay().print("CPU speed:"); getdisplay().setCursor(120, y0 + 48); @@ -146,11 +164,6 @@ public: int cpu_freq = esp_clk_cpu_freq() / 1000000; getdisplay().print(String(cpu_freq)); - getdisplay().setCursor(2, y0 + 64); - getdisplay().print("RTC:"); - getdisplay().setCursor(120, y0 + 64); - getdisplay().print(rtc_module); - getdisplay().setCursor(202, y0 + 64); getdisplay().print("GPS:"); getdisplay().setCursor(300, y0 + 64); @@ -161,6 +174,11 @@ public: getdisplay().setCursor(120, y0 + 80); getdisplay().print(hasFRAM ? "available" : "not found"); + getdisplay().setCursor(202, y0 + 80); + getdisplay().print("RTC:"); + getdisplay().setCursor(300, y0 + 80); + getdisplay().print(rtc_module); + getdisplay().setCursor(2, y0 + 120); getdisplay().print("Firmware Version: "); getdisplay().print(VERSINFO);