Well, it seems a bit hacky - but yes - I don't see anything wrong with that at all.
Another thing you could do if you really want to 'hard' reset the chip is : E.enableWatchdog(0.1);while(1);
The setDeepSleep thing you're doing is really good if using serial-based sensors though.
... what I should do at some point is have a E.shutdownFor(seconds) command that puts the device into proper power-down, but restarts in in X seconds. That'd do what you want but would also be super power-efficient.
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.
Well, it seems a bit hacky - but yes - I don't see anything wrong with that at all.
Another thing you could do if you really want to 'hard' reset the chip is :
E.enableWatchdog(0.1);while(1);
The
setDeepSleep
thing you're doing is really good if using serial-based sensors though.... what I should do at some point is have a
E.shutdownFor(seconds)
command that puts the device into proper power-down, but restarts in in X seconds. That'd do what you want but would also be super power-efficient.