mirror of https://github.com/espruino/BangleApps
gpstrek - Only average if no GPS fix is available
parent
bc9e7b4c86
commit
4df226fb37
|
@ -71,10 +71,11 @@ function average(samples){
|
|||
|
||||
result%=360;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
function onMag(e) {
|
||||
if (!isNaN(e.heading)){
|
||||
if (Bangle.isLocked())
|
||||
if (Bangle.isLocked() || (Bangle.getGPSFix() && Bangle.getGPSFix().lon))
|
||||
state.avgComp = e.heading;
|
||||
else {
|
||||
state.compassSamples[state.sampleIndex++] = e.heading;
|
||||
|
|
Loading…
Reference in New Issue