Worked a bit on a switch for BLE.
To be prepared for surprises, the idea is to calculate available jsVars.
maximum no. of JsVars is 20000
Do you guys agree ?
heapVars = (esp_get_free_heap_size() - 50000) / 16;
heapVars = heapVars - heapVars % 100;
if(heapVars > 20000) heapVars = 20000;
jsVarsSize = heapVars;
One more question could we do something like
Bluetooth = nothing;
NRF = nothing;
or with a new (empty) object called isDisabled
Bluetooth = new(isDisabled());
NRF = new(isDisabled());
© Espruino, powered by microcosm.
Report a problem