mirror of https://github.com/espruino/BangleApps
gpstrek - Reset compass samples on turning it off
parent
811174436d
commit
a6ef1067bf
|
@ -47,7 +47,10 @@ function onPulse(e){
|
||||||
function onGPS(fix) {
|
function onGPS(fix) {
|
||||||
if(fix.fix) {
|
if(fix.fix) {
|
||||||
state.currentPos = fix;
|
state.currentPos = fix;
|
||||||
|
if (Bangle.isCompassOn()){
|
||||||
Bangle.setCompassPower(0, "gpstrek");
|
Bangle.setCompassPower(0, "gpstrek");
|
||||||
|
state.compassSamples = new Array(SAMPLES).fill(0)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
Bangle.setCompassPower(1, "gpstrek");
|
Bangle.setCompassPower(1, "gpstrek");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue