Yes, that's the idea. Normally, you upload to RAM and onInit isn't called - it's almost as if you copy/pasted the code into the left-hand side.
When you type save() it saves it all to flash memory and then restarts, and onInit() gets called.
Ideally it should reload all the HID stuff (the call to NRF.setServices) automatically, even without you sticking it in onInit - but right now it appears that it doesn't. It's something I'll try and fix for the 1v93 firmware.
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.
Great!
Yes, that's the idea. Normally, you upload to RAM and
onInit
isn't called - it's almost as if you copy/pasted the code into the left-hand side.When you type
save()
it saves it all to flash memory and then restarts, andonInit()
gets called.Ideally it should reload all the HID stuff (the call to
NRF.setServices
) automatically, even without you sticking it inonInit
- but right now it appears that it doesn't. It's something I'll try and fix for the 1v93 firmware.