You are reading a single comment by @user156858 and its replies.
Click here to read the full conversation.
-
I'm only familiar with NRF SDK development in C
for sleeping it calls sd_app_evt_wait
https://github.com/espruino/Espruino/blob/master/targets/nrf5x/jshardware.c#L2717
which should be as low power consumption as it can get without powering offIf you have high power draw like 0.5mA or 1mA it may be that you left something powered on like I2C,SPI,UART
The actual processor can be put into a mode that shuts everything down and wakes on external inputs, but that's not something Puck.js does, since the normal sleep functionality (that keeps the internal RTC running as well as all contents of RAM) gets power consumption down to 3uA (6+ years on a CR2032) which seemed more than enough.
So yes, effectively Puck.js does sleep while keeping any counters and the RTC in memory, but that's because the processor is efficient enough at sleeping that it doesn't have to shut everything off.
It's worth noting that Puck.js and other Bluetooth Espruino devices put themselves to sleep automatically, for example:
Will end up with the processor asleep 99% of the time.
All
NRF.sleep()
does is to turn off the Bluetooth advertising, which, when the processor isn't executing JS, is the main power drain (although even that, with the default config, is 40uA)