Skip to content

Commit

Permalink
Merge pull request #3336 from iNavFlight/agh_round_home_direction
Browse files Browse the repository at this point in the history
Round rather than truncate when updating GPS_directionToHome
  • Loading branch information
digitalentity committed Jun 15, 2018
2 parents c4c1b42 + 8e419c6 commit 3d460ce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/navigation/navigation.c
Expand Up @@ -2837,7 +2837,7 @@ void onNewGPSData(void)
int32_t dir;
GPS_distance_cm_bearing(gpsSol.llh.lat, gpsSol.llh.lon, GPS_home.lat, GPS_home.lon, &dist, &dir);
GPS_distanceToHome = dist / 100;
GPS_directionToHome = dir / 100;
GPS_directionToHome = lrintf(dir / 100.0f);
} else {
GPS_distanceToHome = 0;
GPS_directionToHome = 0;
Expand Down

0 comments on commit 3d460ce

Please sign in to comment.