espruino / Espruino

The Espruino JavaScript interpreter - Official Repo
http://www.espruino.com/
Other
2.73k stars 741 forks source link

nRF52 timer wakeups #1900

Open gfwilliams opened 3 years ago

gfwilliams commented 3 years ago

Currently, TIMER1_IRQHandler calls jshHadEvent - so every timer event will take Espruino out of sleep and once around the idle loop.

On Bangle.js it's needed because the peripheralPollHandler doesn't call jshHadEvent (and it doesn't seem to make much/any noticeable difference to power consumption).

However it might be a bigger deal on some other devices that are more conscious of power - not that we generally use the timer by default anyway.

gfwilliams commented 3 years ago

Note: recent bangle.js firmware uses app_timer not the util timer, so it's possible that as long as jstimer.c calls jshHadEvent correctly we'll be fine to remove it in TIMER1_IRQHandler