I just pushed a change to the development BangleApps repo which will allow gpsrec to turn on/off (on recent firmwares) without turning GPS off. The code you have should then work as-is.
It's good practice now to do Bangle.setGPSPower(on, 'appId') - then Bangle.js will keep the GPS on as long as at least one different app needs it - same for compass/etc.
But yes, having a module in gpsrec that contains the code you had above to allow easy toggling would be great.
What's "E-LOG" for out of interest? I guess ideally we'd just return a bool?
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.
I just pushed a change to the development BangleApps repo which will allow
gpsrec
to turn on/off (on recent firmwares) without turning GPS off. The code you have should then work as-is.It's good practice now to do
Bangle.setGPSPower(on, 'appId')
- then Bangle.js will keep the GPS on as long as at least one different app needs it - same for compass/etc.But yes, having a module in
gpsrec
that contains the code you had above to allow easy toggling would be great.What's
"E-LOG"
for out of interest? I guess ideally we'd just return a bool?