From 960599c35a5c80d847730f1f6ef993ceadfc12a7 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Sat, 5 Oct 2024 20:56:49 +0200 Subject: [PATCH] Only raise low memory error if heap is actually low --- RNode_Firmware.ino | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/RNode_Firmware.ino b/RNode_Firmware.ino index 8e675d2..136513e 100644 --- a/RNode_Firmware.ino +++ b/RNode_Firmware.ino @@ -1415,7 +1415,17 @@ void loop() { input_read(); #endif - if (memory_low) { kiss_indicate_error(ERROR_MEMORY_LOW); memory_low = false; } + if (memory_low) { + #if PLATFORM == PLATFORM_ESP32 + if (esp_get_free_heap_size() < 8192) { + kiss_indicate_error(ERROR_MEMORY_LOW); memory_low = false; + } else { + memory_low = false; + } + #else + kiss_indicate_error(ERROR_MEMORY_LOW); memory_low = false; + #endif + } } void sleep_now() {