From: Keith Packard Date: Wed, 18 Jul 2012 06:59:13 +0000 (-0700) Subject: altos: Toggling telemetry monitoring would replay the telem queue X-Git-Tag: 1.1~71^2~2 X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=a698cd68968fc0be5f96b1729cdea2f65d2ccbf6;p=fw%2Faltos altos: Toggling telemetry monitoring would replay the telem queue Using the 'm' command to turn telem off and back on would end up going around the whole telemetry queue replaying everything there as the wait loop would exit when disabling monitoring even if the ring was empty. Signed-off-by: Keith Packard --- diff --git a/src/core/ao_monitor.c b/src/core/ao_monitor.c index d492e32a..5876bef7 100644 --- a/src/core/ao_monitor.c +++ b/src/core/ao_monitor.c @@ -132,6 +132,8 @@ ao_monitor_put(void) ao_sleep(DATA_TO_XDATA(&ao_external_monitoring)); while (ao_monitor_tail == ao_monitor_head && ao_external_monitoring) ao_sleep(DATA_TO_XDATA(&ao_monitor_head)); + if (!ao_external_monitoring) + continue; m = &ao_monitor_ring[ao_monitor_tail]; ao_monitor_tail = ao_monitor_ring_next(ao_monitor_tail); switch (ao_monitoring) {