projects
/
fw
/
altos
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e44ce12
)
altos: Broke TeleMetrum GPS reporting by holding the GPS mutex too much
author
Keith Packard
<keithp@keithp.com>
Wed, 18 Dec 2013 04:23:00 +0000
(20:23 -0800)
committer
Keith Packard
<keithp@keithp.com>
Wed, 18 Dec 2013 04:23:00 +0000
(20:23 -0800)
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>
src/core/ao_gps_report.c
patch
|
blob
|
history
diff --git
a/src/core/ao_gps_report.c
b/src/core/ao_gps_report.c
index 8d15c083c905c2d149d22c1294e61b6bebeac387..07201ac235b69cd1656979fae18aaa94327c2d73 100644
(file)
--- 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)