I'm afraid there isn't a way of disabling the removal of 'boot code' in Espruino at the moment, it's built into the firmware.
However on a long-press, the only files that get removed are the ones created by E.setBootCode and save(). On http://www.espruino.com/Saving#combining-options you'll see there are a few other files that get executed - .boot0/etc.
If you write your code to .boot0 using require("Storage").write then it won't get erased by the long-press at boot, which should be what you want.
I'm afraid bonding data will still be cleared though.
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'm afraid there isn't a way of disabling the removal of 'boot code' in Espruino at the moment, it's built into the firmware.
However on a long-press, the only files that get removed are the ones created by
E.setBootCode
andsave()
. On http://www.espruino.com/Saving#combining-options you'll see there are a few other files that get executed -.boot0
/etc.If you write your code to
.boot0
usingrequire("Storage").write
then it won't get erased by the long-press at boot, which should be what you want.I'm afraid bonding data will still be cleared though.