On my Espruino, onInit and doInit are DEFINITELY running - if they weren't, it wouldn't work at all. On my Espruino, I've always been able to put strings into setTimeout/setInterval. The IDE warns me that it's "evil", but it works fine*. What I didn't realize is that you could just pass it the name of a function, unquoted, and have it call that function with no arguments! I thought you had to do:
setTimeout(function(){doInit();},2000);
So in your case, it sorts itself out after enough disk errors happen? I don't think it was coming back to life for me, will check logs tonight.
*Note that I have not tested whether this "evil" evaluation has resulted in my eternal damnation; testing this seems like a real chore.
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.
Hm.
On my Espruino, onInit and doInit are DEFINITELY running - if they weren't, it wouldn't work at all. On my Espruino, I've always been able to put strings into setTimeout/setInterval. The IDE warns me that it's "evil", but it works fine*. What I didn't realize is that you could just pass it the name of a function, unquoted, and have it call that function with no arguments! I thought you had to do:
setTimeout(function(){doInit();},2000);
So in your case, it sorts itself out after enough disk errors happen? I don't think it was coming back to life for me, will check logs tonight.
*Note that I have not tested whether this "evil" evaluation has resulted in my eternal damnation; testing this seems like a real chore.