aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Gubler <thomasgubler@gmail.com>2014-05-30 16:09:05 +0200
committerThomas Gubler <thomasgubler@gmail.com>2014-05-30 16:09:52 +0200
commita43e963bdb73e6fa0480d442e72e1d764418cad4 (patch)
tree988486260ae9df7536461f01ec35f8f50a081281
parentdc336a2ea4528489570e4eedb2b5102d699ad023 (diff)
downloadpx4-firmware-a43e963bdb73e6fa0480d442e72e1d764418cad4.tar.gz
px4-firmware-a43e963bdb73e6fa0480d442e72e1d764418cad4.tar.bz2
px4-firmware-a43e963bdb73e6fa0480d442e72e1d764418cad4.zip
geo: fix logic of globallocal converter initialization to depend on map projection initialization
-rw-r--r--src/lib/geo/geo.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/lib/geo/geo.c b/src/lib/geo/geo.c
index b1e038323..235da5b39 100644
--- a/src/lib/geo/geo.c
+++ b/src/lib/geo/geo.c
@@ -207,8 +207,14 @@ __EXPORT int globallocalconverter_init(double lat_0, double lon_0, float alt_0,
{
if (strcmp("commander", getprogname() == 0)) {
gl_ref.alt = alt_0;
- gl_ref.init_done = true;
- return map_projection_global_init(lat_0, lon_0, timestamp);
+ if (!map_projection_global_init(lat_0, lon_0, timestamp))
+ {
+ gl_ref.init_done = true;
+ return 0;
+ } else {
+ gl_ref.init_done = false;
+ return -1;
+ }
} else {
return -1;
}