From 8744fd5d541955b0920c7d8e2696039cdcfdf1dc Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Tue, 30 Apr 2013 00:05:33 -0700 Subject: [PATCH] altos: Make cc1120 driver return false on recv timeout Was returning an uninitialized value, which was often not zero Signed-off-by: Keith Packard --- src/drivers/ao_cc1120.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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, -- 2.30.2