From 17adfd7939ff697afa96f7207a3fe17b6af789bd Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Wed, 27 Jul 2016 12:24:27 -0700 Subject: altos: Keep telemetry and command output from interleaving When monitoring telemetry, the frame needs to be sent together on one line, not split with the output of a command (like 'a') mixed in. Use a mutex for products with monitoring to keep command output and telemetry output each on separate lines. Signed-off-by: Keith Packard --- src/kernel/ao_cmd.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/kernel/ao_cmd.c') diff --git a/src/kernel/ao_cmd.c b/src/kernel/ao_cmd.c index 605a2f20..10716afd 100644 --- a/src/kernel/ao_cmd.c +++ b/src/kernel/ao_cmd.c @@ -394,11 +394,17 @@ ao_cmd(void) if (func) break; } +#if HAS_MONITOR + ao_mutex_get(&ao_monitoring_mutex); +#endif if (func) (*func)(); else ao_cmd_status = ao_cmd_syntax_error; report(); +#if HAS_MONITOR + ao_mutex_put(&ao_monitoring_mutex); +#endif } } -- cgit v1.2.3