I'm pretty sure it's because you were using 'save on send' in the IDE as well as save().
Basically 'save on send' writes the raw JS code straight into flash memory, and if you use a function it then references that memory rather than copying the code straight out. That's fine, but if you then type E.setBootCode() it'll clear what was in flash memory and will cause all the functions that were defined in flash to be erased. If you then type save() it'll save that state - including the dodgy references - to flash.
E.setBootCode() should have cleared everything - however by itself it won't reset the interpreter state to you won't see the problem solved immediately. Probably E.setBootCode();reset() would work if you have the problem again.
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 pretty sure it's because you were using 'save on send' in the IDE as well as
save()
.Basically 'save on send' writes the raw JS code straight into flash memory, and if you use a function it then references that memory rather than copying the code straight out. That's fine, but if you then type
E.setBootCode()
it'll clear what was in flash memory and will cause all the functions that were defined in flash to be erased. If you then typesave()
it'll save that state - including the dodgy references - to flash.E.setBootCode()
should have cleared everything - however by itself it won't reset the interpreter state to you won't see the problem solved immediately. ProbablyE.setBootCode();reset()
would work if you have the problem again.