When an interval gets forcibly cleared like that, how can one detect that and react appropriately?
Good point. There's not an easy way right now until exceptions get implemented - however the best bet at the moment is something like:
setInterval(function() { ... wifiSuccess = false; setTimeout(function() { // initialise WLAN wifiSuccess = true; }, 10); setTimeout(function() { if (!wifiSuccess) { ... } }, 1000); , 60000);
If there's an error in wlan.connect, the error flag will be set and execution will stop - so wifiSuccess will never get set to true.
@Gordon started
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.
Good point. There's not an easy way right now until exceptions get implemented - however the best bet at the moment is something like:
If there's an error in wlan.connect, the error flag will be set and execution will stop - so wifiSuccess will never get set to true.