On the latest firmwares, they keep track of which software request which hardware. For example something might say Bangle.setHRMPower(1,"widhrm"), and that info gets stored in Bangle._PWR.HRM, which is ["app"].
So, you could do Bangle._PWR.HRM = []; Bangle.setHRMPower(0) which would turn the HRM off. If you want to stop an app turning it back on at any point later, you could just change the function: Bangle.setHRMPower = function(){}
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.
On the latest firmwares, they keep track of which software request which hardware. For example something might say
Bangle.setHRMPower(1,"widhrm")
, and that info gets stored inBangle._PWR.HRM
, which is["app"]
.So, you could do
Bangle._PWR.HRM = []; Bangle.setHRMPower(0)
which would turn the HRM off. If you want to stop an app turning it back on at any point later, you could just change the function:Bangle.setHRMPower = function(){}