diff options
author | Keith Packard <keithp@keithp.com> | 2016-07-27 12:24:27 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2016-07-27 12:24:27 -0700 |
commit | 17adfd7939ff697afa96f7207a3fe17b6af789bd (patch) | |
tree | 35d5e1145121b0be0e20fd9820d69f1347abde79 /src/kernel/ao_monitor.c | |
parent | 1667cb8e8b702b05fc3ec39ee49029885df64a4a (diff) |
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 <keithp@keithp.com>
Diffstat (limited to 'src/kernel/ao_monitor.c')
-rw-r--r-- | src/kernel/ao_monitor.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/kernel/ao_monitor.c b/src/kernel/ao_monitor.c index 8a5a04ba..9912161b 100644 --- a/src/kernel/ao_monitor.c +++ b/src/kernel/ao_monitor.c @@ -36,6 +36,7 @@ #error Must define AO_MONITOR_LED #endif +__data uint8_t ao_monitoring_mutex; __data uint8_t ao_monitoring; static __data uint8_t ao_monitor_disabled; static __data uint8_t ao_internal_monitoring; @@ -241,6 +242,7 @@ ao_monitor_put(void) printf ("rx cleanup: %d\n", ao_rx_done_tick - ao_fec_decode_end); } #endif + ao_mutex_get(&ao_monitoring_mutex); printf("TELEM "); hex((uint8_t) (ao_monitoring + 2)); sum = 0x5a; @@ -251,6 +253,7 @@ ao_monitor_put(void) } hex(sum); putchar ('\n'); + ao_mutex_put(&ao_monitoring_mutex); #if HAS_RSSI if (recv_raw.packet[ao_monitoring + 1] & AO_RADIO_STATUS_CRC_OK) { rssi = AO_RSSI_FROM_RADIO(recv_raw.packet[ao_monitoring]); |