diff options
author | Keith Packard <keithp@keithp.com> | 2010-11-26 16:14:15 -0800 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2010-12-22 20:39:40 -0800 |
commit | 07213dc34fa20470a4b36a327a83d75b0f010ebb (patch) | |
tree | a85d444ab7d2ccf01153c15e6fb2adf8473b602f /src/ao_packet_master.c | |
parent | b62580855c5144f5bc7e0172289bce08814d9472 (diff) |
altos: clean up radio abort paths. Share radio code.
Instead of aborting the DMA and radio operation and expecting that to
be handled reasonably by the radio receiving task, rewrite things so
that the abort function just wakes the receiving task while that
terminates the DMA and cleans up the radio.
This eliminates all kinds of nasty bugs dealing with radio abort
smashing the radio registers at the wrong time, or interrupting a
radio transmission.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/ao_packet_master.c')
-rw-r--r-- | src/ao_packet_master.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/ao_packet_master.c b/src/ao_packet_master.c index 641b49f4..3b23ad92 100644 --- a/src/ao_packet_master.c +++ b/src/ao_packet_master.c @@ -77,8 +77,6 @@ ao_packet_master_check_busy(void) void ao_packet_master(void) { - uint8_t status; - ao_config_get(); ao_radio_set_packet(); ao_tx_packet.addr = ao_serial_number; @@ -92,8 +90,7 @@ ao_packet_master(void) ao_packet_master_busy(); ao_packet_master_check_busy(); ao_alarm(ao_packet_master_delay); - status = ao_packet_recv(); - if (status & AO_DMA_DONE) { + if (ao_packet_recv()) { /* if we can transmit data, do so */ if (ao_packet_tx_used && ao_tx_packet.len == 0) continue; |