You'll be able to do E.setBootupCode(E.dumpStr()) which will have pretty much the same effect.
Actually avoiding the problem by just not totally resetting is a really interesting thought though - it solves a whole lot of problems.
would it be possible to add a step in compilation that writes a .js file into the binary as an initial program?
Yep - that's kind of the idea with E.setBootupCode - what is does could also be done in the compilation process... or, like you can do right now you can actually just save() your code, and can then go into bootloader mode and read the whole binary out (including your saved code).
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.
You'll be able to do
E.setBootupCode(E.dumpStr())
which will have pretty much the same effect.Actually avoiding the problem by just not totally resetting is a really interesting thought though - it solves a whole lot of problems.
Yep - that's kind of the idea with
E.setBootupCode
- what is does could also be done in the compilation process... or, like you can do right now you can actually justsave()
your code, and can then go into bootloader mode and read the whole binary out (including your saved code).