mirror of https://github.com/espruino/BangleApps
gpstrek - Remove obsolete compass heading workaround
parent
5374b1af30
commit
c382bef7d9
|
@ -683,7 +683,7 @@ const compassSliceData = {
|
|||
},
|
||||
getCourse: function (){
|
||||
if(compassSliceData.getCourseType() == "GPS") return state.currentPos.course;
|
||||
return state.compassHeading?360-state.compassHeading:undefined;
|
||||
return state.compassHeading?state.compassHeading:undefined;
|
||||
},
|
||||
getPoints: function (){
|
||||
let points = [];
|
||||
|
|
|
@ -24,7 +24,7 @@ function onGPS(fix) {
|
|||
}
|
||||
|
||||
function onMag(e) {
|
||||
if (!state.compassHeading) state.compassHeading = 360-e.heading;
|
||||
if (!state.compassHeading) state.compassHeading = e.heading;
|
||||
|
||||
//if (a+180)mod 360 == b then
|
||||
//return (a+b)/2 mod 360 and ((a+b)/2 mod 360) + 180 (they are both the solution, so you may choose one depending if you prefer counterclockwise or clockwise direction)
|
||||
|
|
Loading…
Reference in New Issue