I set the setting and don't use any other apps for a while.
Ok, as long as you don't load any other apps after you do NRF.sleep it should be fine?
So you confirm that all the apps on the device check the setting in settings.json?
When you load any app, everything is reset to default. Then the bootloader runs and that checks settings.json and configures everything accordingly.
Wouldn't it make sense to have a reference layer
Well, currently setXYZPower has a second argument where you add some kind of ID - so the Bangle knows to keep the required device on as long as at least one bit of code needs it.
But there is no general framework for forcing devices off or checking whether Bluetooth is off. It hasn't really come up to date
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.
Ok, as long as you don't load any other apps after you do
NRF.sleep
it should be fine?When you load any app, everything is reset to default. Then the bootloader runs and that checks
settings.json
and configures everything accordingly.Well, currently
setXYZPower
has a second argument where you add some kind of ID - so the Bangle knows to keep the required device on as long as at least one bit of code needs it.But there is no general framework for forcing devices off or checking whether Bluetooth is off. It hasn't really come up to date