@Sacha, any dynamic, time oriented 'thing' should be started by onInit() or E.on("init",function(){...}) - including intervals/timers - to guarantee expected behavior. Yes, the interval/timer itself may not need it, but its the functions triggered by them that may not be able to complete (when you upload). And personally, I wonder if timer (setTimeout();) actually works when only happens on upload. And when it works, the timing behavior in respect to the context is for sure different.
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.
@Sacha, any dynamic, time oriented 'thing' should be started by
onInit()
orE.on("init",function(){...})
- including intervals/timers - to guarantee expected behavior. Yes, the interval/timer itself may not need it, but its the functions triggered by them that may not be able to complete (when you upload). And personally, I wonder if timer (setTimeout();
) actually works when only happens on upload. And when it works, the timing behavior in respect to the context is for sure different.