diff options
author | Keith Packard <keithp@keithp.com> | 2013-12-17 20:23:00 -0800 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2013-12-17 20:23:00 -0800 |
commit | 2ecb6a8276b2ce40d2a4da586dbc17581cfda26d (patch) | |
tree | b825676312be6b0e6af8b3a4b61007dec2761be6 | |
parent | e44ce127ece149e7b07be49142bc0f9d50bbe97d (diff) |
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 <keithp@keithp.com>
-rw-r--r-- | src/core/ao_gps_report.c | 2 |
1 files changed, 1 insertions, 1 deletions
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) |