Worked a bit on a switch for BLE. To be prepared for surprises, the idea is to calculate available jsVars. Assumptions are:
maximum no. of JsVars is 20000 Do you guys agree ?
int heapVars; heapVars = (esp_get_free_heap_size() - 50000) / 16; heapVars = heapVars - heapVars % 100; if(heapVars > 20000) heapVars = 20000; jsVarsSize = heapVars; jsvInit();
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());
@JumJum started
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.
Worked a bit on a switch for BLE.
To be prepared for surprises, the idea is to calculate available jsVars.
Assumptions are:
maximum no. of JsVars is 20000
Do you guys agree ?
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());