summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2013-04-30 00:05:33 -0700
committerKeith Packard <keithp@keithp.com>2013-04-30 00:05:33 -0700
commitef201c20a545e79a1b8aba69c433efc4d0774b9b (patch)
tree5a91a8f6b7fc75ccdb29261128ed1f3bfe1977db
parent0729a74897ea24f6033fdc56cf8b048b60814cca (diff)
altos: Make cc1120 driver return false on recv timeout
Was returning an uninitialized value, which was often not zero Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r--src/drivers/ao_cc1120.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/drivers/ao_cc1120.c b/src/drivers/ao_cc1120.c
index b6b77a5a..3bef6c90 100644
--- a/src/drivers/ao_cc1120.c
+++ b/src/drivers/ao_cc1120.c
@@ -964,8 +964,10 @@ ao_radio_recv(__xdata void *d, uint8_t size, uint8_t timeout)
/* Wait for the preamble to appear */
ao_radio_wait_isr(timeout);
- if (ao_radio_abort)
+ if (ao_radio_abort) {
+ ret = 0;
goto abort;
+ }
ao_radio_reg_write(AO_CC1120_INT_GPIO_IOCFG, CC1120_IOCFG_GPIO_CFG_CLKEN_SOFT);
ao_exti_set_mode(AO_CC1120_INT_PORT, AO_CC1120_INT_PIN,