aboutsummaryrefslogtreecommitdiffstats
path: root/src/recoveryLoader.cpp
diff options
context:
space:
mode:
authorJean-François Milants <jf@codingfield.com>2023-03-26 14:53:34 +0200
committerJF <JF002@users.noreply.github.com>2023-05-18 19:58:09 +0200
commit611e0ff7684818949f7f18546b540ff55de9b8ce (patch)
tree250ed0efe624fdc7992b27d6ab40ed5092d6bc87 /src/recoveryLoader.cpp
parent1911e2d9285cb5b0a6ecd3bf3de864783f2b0e3e (diff)
Enable malloc error and stack overflow error detection in FreeRTOS. Count them and display them in the SystemInfo app.
Diffstat (limited to 'src/recoveryLoader.cpp')
-rw-r--r--src/recoveryLoader.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/recoveryLoader.cpp b/src/recoveryLoader.cpp
index d6f8d49b..0a4aa622 100644
--- a/src/recoveryLoader.cpp
+++ b/src/recoveryLoader.cpp
@@ -139,6 +139,18 @@ void DisplayProgressBar(uint8_t percent, uint16_t color) {
}
}
+int mallocFailedCount = 0;
+int stackOverflowCount = 0;
+extern "C" {
+void vApplicationMallocFailedHook() {
+ mallocFailedCount++;
+}
+
+void vApplicationStackOverflowHook(TaskHandle_t /*xTask*/, char */*pcTaskName*/) {
+ stackOverflowCount++;
+}
+}
+
int main(void) {
TaskHandle_t taskHandle;
RefreshWatchdog();