diff options
author | Keith Packard <keithp@keithp.com> | 2009-05-13 20:40:42 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2009-05-13 20:40:42 -0700 |
commit | 9b974217958b1017e62d6c4f4568f547ccc30c58 (patch) | |
tree | f38fbb8b2f3b0e70ce9427273619d19a0fe362d6 /ao_monitor.c | |
parent | 25fc03a333b2cfad0a93ebc385fbcf74b63c229e (diff) |
Enable radio monitor by default in teleterra, teledongle and tidongle
These ground loads want to monitor the radio constantly, and not require use
of the 'm' command before listening.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'ao_monitor.c')
-rw-r--r-- | ao_monitor.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/ao_monitor.c b/ao_monitor.c index 2f6584bc..6aed581a 100644 --- a/ao_monitor.c +++ b/ao_monitor.c @@ -61,24 +61,30 @@ ao_monitor(void) __xdata struct ao_task ao_monitor_task; +void +ao_set_monitor(uint8_t monitoring) +{ + ao_monitoring = monitoring; + ao_wakeup(&ao_monitoring); +} + static void -ao_set_monitor(void) +set_monitor(void) { ao_cmd_hex(); - ao_monitoring = ao_cmd_lex_i != 0; - ao_wakeup(&ao_monitoring); + ao_set_monitor(ao_cmd_lex_i != 0); } __code struct ao_cmds ao_monitor_cmds[] = { - { 'm', ao_set_monitor, "m <0 off, 1 on> Enable/disable radio monitoring" }, - { 0, ao_set_monitor, NULL }, + { 'm', set_monitor, "m <0 off, 1 on> Enable/disable radio monitoring" }, + { 0, set_monitor, NULL }, }; void -ao_monitor_init(uint8_t monitor_led) +ao_monitor_init(uint8_t monitor_led, uint8_t monitoring) __reentrant { ao_monitor_led = monitor_led; - ao_monitoring = 0; + ao_monitoring = monitoring; ao_cmd_register(&ao_monitor_cmds[0]); ao_add_task(&ao_monitor_task, ao_monitor, "monitor"); } |