Store online_interface_list in heap, preventing errors on ESP32
This commit is contained in:
parent
24543e5f5a
commit
acb74f61d4
@ -143,7 +143,7 @@ const uint8_t pages = 3;
|
|||||||
uint8_t disp_page = START_PAGE;
|
uint8_t disp_page = START_PAGE;
|
||||||
uint8_t interface_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;
|
uint8_t online_interfaces = 0;
|
||||||
|
|
||||||
@ -689,7 +689,6 @@ void draw_stat_area() {
|
|||||||
online_interfaces = 2;
|
online_interfaces = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
online_interface_list = (uint8_t*)malloc(online_interfaces);
|
|
||||||
uint8_t index = 0;
|
uint8_t index = 0;
|
||||||
|
|
||||||
for (int i = 0; i < INTERFACE_COUNT; i++) {
|
for (int i = 0; i < INTERFACE_COUNT; i++) {
|
||||||
@ -1119,7 +1118,6 @@ void update_display(bool blank = false) {
|
|||||||
update_disp_area();
|
update_disp_area();
|
||||||
display.display(true);
|
display.display(true);
|
||||||
#endif
|
#endif
|
||||||
free(online_interface_list);
|
|
||||||
last_disp_update = millis();
|
last_disp_update = millis();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user