From: Keith Packard Date: Wed, 18 Dec 2013 04:23:00 +0000 (-0800) Subject: altos: Broke TeleMetrum GPS reporting by holding the GPS mutex too much X-Git-Tag: 1.3~33 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=2ecb6a8276b2ce40d2a4da586dbc17581cfda26d;ds=inline 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 --- 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)