From fe2edadaf4dba75a9f4ee0def97c6f5db563f8d2 Mon Sep 17 00:00:00 2001 From: Gary Ott Date: Mon, 28 Nov 2022 18:19:12 +0000 Subject: [PATCH] ESP32: Take advantage of JsVars being smaller. --- targets/esp32/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/targets/esp32/main.c b/targets/esp32/main.c index c418cff88..dbdb6022a 100644 --- a/targets/esp32/main.c +++ b/targets/esp32/main.c @@ -60,7 +60,7 @@ static void espruinoTask(void *data) { initADC(1); jshInit(); // Initialize the hardware jswHWInit(); - heapVars = (esp_get_free_heap_size() - 40000) / 16; //calculate space for jsVars + heapVars = (esp_get_free_heap_size() - 40000) / sizeof(JsVar); //calculate space for jsVars heapVars = heapVars - heapVars % 100; //round to 100 if(heapVars > 20000) heapVars = 20000; //WROVER boards have much more RAM, so we set a limit jsvInit(heapVars); // Initialize the variables