From a698cd68968fc0be5f96b1729cdea2f65d2ccbf6 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Tue, 17 Jul 2012 23:59:13 -0700 Subject: [PATCH] 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 --- src/core/ao_monitor.c | 2 ++ 1 file changed, 2 insertions(+) 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) { -- 2.30.2