From 2ecb6a8276b2ce40d2a4da586dbc17581cfda26d Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Tue, 17 Dec 2013 20:23:00 -0800 Subject: [PATCH] altos: Broke TeleMetrum GPS reporting by holding the GPS mutex too much We can't hold the GPS mutex while waiting for the GPS receiver to load data as it protects the GPS data with the GPS mutex. Signed-off-by: Keith Packard --- src/core/ao_gps_report.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/ao_gps_report.c b/src/core/ao_gps_report.c index 8d15c083..07201ac2 100644 --- a/src/core/ao_gps_report.c +++ b/src/core/ao_gps_report.c @@ -27,9 +27,9 @@ ao_gps_report(void) uint8_t new; for (;;) { - ao_mutex_get(&ao_gps_mutex); while ((new = ao_gps_new) == 0) ao_sleep(&ao_gps_new); + ao_mutex_get(&ao_gps_mutex); if (new & AO_GPS_NEW_DATA) ao_xmemcpy(&gps_data, &ao_gps_data, sizeof (ao_gps_data)); if (new & AO_GPS_NEW_TRACKING) -- 2.30.2