Only raise low memory error if heap is actually low

This commit is contained in:
Mark Qvist 2024-10-05 20:56:49 +02:00
parent bfc215b2a3
commit 960599c35a
1 changed files with 11 additions and 1 deletions

View File

@ -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() {