• You might be able to use E.enableWatchdog(seconds) - this won't work on ESP8266, but there's basically a 1 sec watchdog enabled by default.

    If Espruino doesn't get back to the idle loop within some time period it'll crash, so your code would look like:

    function onInit() {
      if (f.read(ok) == false) return; // fallback
      f.write(ok,0);
      eval(f.read(code));
      if (all ok) f.write(ok,1);
    }
    
About

Avatar for Gordon @Gordon started