if board.info["variables_mode"]:
codeOut('#define VARIABLES_MODE_'+board.info["variables_mode"].upper() + ' // mode for allocating memory, standard is statically assigned');
codeOut('');
...
if board.chip["class"]=="ESP32":
codeOut("#define JSVAR_CACHE_SIZE_PSRAM "+str(board.info['variables_psram'])+" // Number of Javascript variables in RAM for boards with additional RAM (like ESP32 WROVER)");
last not least in main.c
if(esp_get_free_heap_size() > 0x300000) jsVarsSize = JSVAR_CACHE_SIZE_PSRAM; // looks like 4MB SPI_RAM is enabled for heap, pretty sure there is a better way, but for now ....
else jsVarsSize = JSVAR_CACHE_SIZE; // number of variables for boards without additional SPI RAM
jsvInit(); // Initialize the variables
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
I got it running this way.
Simple board gives me 2000 vars
Board with additional PSRAM gives me 20000 vars.
@DrAzzy, we could use 65500 here too
ESP32.py
jsvar.h
jsvar.c
build_platform_config.py
last not least in main.c