From 11cb13cdcb190bb7732608c84b1e07fed7b929b2 Mon Sep 17 00:00:00 2001 From: Andy Spencer Date: Wed, 15 Feb 2012 05:34:52 +0000 Subject: [PATCH] Save previous heading in case of nan For some reason my GPS is giving me NaN's instead of headings.. --- src/plugins/gps-plugin.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/plugins/gps-plugin.c b/src/plugins/gps-plugin.c index 977fcb7..c2ef65e 100644 --- a/src/plugins/gps-plugin.c +++ b/src/plugins/gps-plugin.c @@ -840,7 +840,10 @@ static void process_gps(gpointer data, gint source, GdkInputCondition condition) /* Process any data from the gps and call the hook function */ if (gps_data != NULL) { + gdouble track = gps_data->fix.track; gint result = gps_read(gps_data); + if (isnan(gps_data->fix.track)) + gps_data->fix.track = track; g_debug("GritsPluginGps: process_gps - gps_read returned %d, " "position %f, %f.", result, gps_data->fix.latitude, gps_data->fix.longitude); -- 2.43.2