X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fcc1111%2Fao_radio.c;h=166d14d5e9e67cd5e4b92828714bb0bc64af0342;hb=171d12cb7bb0ea185e9b8b6d90e1c0fb94b19008;hp=b9821a4237ab950caecebb6bac85defb30ccbff2;hpb=f0d2d34f84980ab45ecedae17546f4d71e020c5e;p=fw%2Faltos diff --git a/src/cc1111/ao_radio.c b/src/cc1111/ao_radio.c index b9821a42..166d14d5 100644 --- a/src/cc1111/ao_radio.c +++ b/src/cc1111/ao_radio.c @@ -3,7 +3,8 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of @@ -451,13 +452,9 @@ ao_radio_recv(__xdata void *packet, uint8_t size, uint8_t timeout) __reentrant /* Wait for DMA to be done, for the radio receive process to * get aborted or for a receive timeout to fire */ - if (timeout) - ao_alarm(timeout); __critical while (!ao_radio_dma_done && !ao_radio_abort) - if (ao_sleep(&ao_radio_dma_done)) + if (ao_sleep_for(&ao_radio_dma_done, timeout)) break; - if (timeout) - ao_clear_alarm(); /* If recv was aborted, clean up by stopping the DMA engine * and idling the radio @@ -591,13 +588,13 @@ ao_radio_rdf_abort(void) /* Output carrier */ -static __xdata ao_radio_test_on; +static __xdata radio_test_on; void ao_radio_test(uint8_t on) { if (on) { - if (!ao_radio_test_on) { + if (!radio_test_on) { #if HAS_MONITOR ao_monitor_disable(); #endif @@ -609,13 +606,13 @@ ao_radio_test(uint8_t on) #endif ao_radio_get(0xff); RFST = RFST_STX; - ao_radio_test_on = 1; + radio_test_on = 1; } } else { - if (ao_radio_test_on) { + if (radio_test_on) { ao_radio_idle(); ao_radio_put(); - ao_radio_test_on = 0; + radio_test_on = 0; #if HAS_MONITOR ao_monitor_enable(); #endif