projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Pad callsign with nuls
[fw/altos]
/
ao_monitor.c
diff --git
a/ao_monitor.c
b/ao_monitor.c
index 15b56f058b6ab821c5083aae01ade569a53915ab..17eee5a3e52b1c1d819daf5c0e5b9c66d8071691 100644
(file)
--- a/
ao_monitor.c
+++ b/
ao_monitor.c
@@
-29,6
+29,7
@@
void
ao_monitor(void)
{
__xdata struct ao_radio_recv recv;
ao_monitor(void)
{
__xdata struct ao_radio_recv recv;
+ __xdata char callsign[AO_MAX_CALLSIGN+1];
uint8_t state;
for (;;) {
uint8_t state;
for (;;) {
@@
-36,14
+37,17
@@
ao_monitor(void)
ao_sleep(&ao_monitoring);
ao_radio_recv(&recv);
state = recv.telemetry.flight_state;
ao_sleep(&ao_monitoring);
ao_radio_recv(&recv);
state = recv.telemetry.flight_state;
+ memcpy(callsign, recv.telemetry.callsign, AO_MAX_CALLSIGN);
if (state > ao_flight_invalid)
state = ao_flight_invalid;
if (state > ao_flight_invalid)
state = ao_flight_invalid;
- printf ("SERIAL %3d RSSI %3d STATUS %02x STATE %s ",
- recv.telemetry.addr, recv.rssi, recv.status,
+ printf ("CALL %s SERIAL %3d RSSI %3d STATUS %02x STATE %7s ",
+ callsign,
+ recv.telemetry.addr,
+ (int) recv.rssi - 74, recv.status,
ao_state_names[state]);
if (!(recv.status & PKT_APPEND_STATUS_1_CRC_OK))
printf("CRC INVALID ");
ao_state_names[state]);
if (!(recv.status & PKT_APPEND_STATUS_1_CRC_OK))
printf("CRC INVALID ");
- printf("%5u a: %
d p: %d t: %d v: %d d: %d m: %
d ",
+ printf("%5u a: %
5d p: %5d t: %5d v: %5d d: %5d m: %5
d ",
recv.telemetry.adc.tick,
recv.telemetry.adc.accel,
recv.telemetry.adc.pres,
recv.telemetry.adc.tick,
recv.telemetry.adc.accel,
recv.telemetry.adc.pres,
@@
-68,7
+72,7
@@
ao_set_monitor(void)
}
__code struct ao_cmds ao_monitor_cmds[] = {
}
__code struct ao_cmds ao_monitor_cmds[] = {
- { '
M', ao_set_monitor, "M
Enable/disable radio monitoring" },
+ { '
m', ao_set_monitor, "m <0 off, 1 on>
Enable/disable radio monitoring" },
{ 0, ao_set_monitor, NULL },
};
{ 0, ao_set_monitor, NULL },
};