will print '42' the next time around, even if it's not global.
The one 'gotcha' is that save() is executed when the interpreter is idle, so:
function foo() {
console.log("Hello");
save();
console.log("World");
}
Will print 'Hello', then 'World', then it will save the state.
It's probably not a nightmare to run Espruino bare-metal on the Pi, but the second you want USB/Ethernet/Video/Sound/etc it's going to turn into an enormous amount of work :)
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.
Everything is saved that you'd expect if you took a 'snapshot' of memory... So:
will print '42' the next time around, even if it's not global.
The one 'gotcha' is that
save()
is executed when the interpreter is idle, so:Will print 'Hello', then 'World', then it will save the state.
It's probably not a nightmare to run Espruino bare-metal on the Pi, but the second you want USB/Ethernet/Video/Sound/etc it's going to turn into an enormous amount of work :)