From acb74f61d44d333c1b7312e4e41bfe1f28843a31 Mon Sep 17 00:00:00 2001 From: "jacob.eva" Date: Thu, 4 Jul 2024 13:40:03 +0100 Subject: [PATCH] Store online_interface_list in heap, preventing errors on ESP32 --- Display.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Display.h b/Display.h index 5cbbe08..2d60f72 100644 --- a/Display.h +++ b/Display.h @@ -143,7 +143,7 @@ const uint8_t pages = 3; uint8_t disp_page = START_PAGE; uint8_t interface_page = START_PAGE; -uint8_t* online_interface_list; +uint8_t online_interface_list[INTERFACE_COUNT] = {0}; uint8_t online_interfaces = 0; @@ -689,7 +689,6 @@ void draw_stat_area() { online_interfaces = 2; } - online_interface_list = (uint8_t*)malloc(online_interfaces); uint8_t index = 0; for (int i = 0; i < INTERFACE_COUNT; i++) { @@ -1119,7 +1118,6 @@ void update_display(bool blank = false) { update_disp_area(); display.display(true); #endif - free(online_interface_list); last_disp_update = millis(); } }