I noticed that a Flash memory speed optimisation that went in recently was keeping the CS pin low while in sleep. By putting that high and issuing a power down command to it, I've saved 0.3mA, so idle power consumption is down to 0.85mA now.
However, I then restarted, and with entirely standard firmware that had been showing the lowest power consumption we'd ever had, and with standard apps, it started drawing 3mA
So I'm not really sure how I can reproduce it, but you're totally right. Somehow it can get into a mode where it draws a bunch of power - but that may not have much to do with the JS or even the firmware itself.
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.
Just an update on this:
I noticed that a Flash memory speed optimisation that went in recently was keeping the CS pin low while in sleep. By putting that high and issuing a power down command to it, I've saved 0.3mA, so idle power consumption is down to 0.85mA now.
However, I then restarted, and with entirely standard firmware that had been showing the lowest power consumption we'd ever had, and with standard apps, it started drawing 3mA
So I'm not really sure how I can reproduce it, but you're totally right. Somehow it can get into a mode where it draws a bunch of power - but that may not have much to do with the JS or even the firmware itself.