altos: Make cc1120 driver return false on recv timeout
authorKeith Packard <keithp@keithp.com>
Tue, 30 Apr 2013 07:05:33 +0000 (00:05 -0700)
committerKeith Packard <keithp@keithp.com>
Wed, 8 May 2013 03:08:00 +0000 (20:08 -0700)
Was returning an uninitialized value, which was often not zero

Signed-off-by: Keith Packard <keithp@keithp.com>
src/drivers/ao_cc1120.c

index b6b77a5a5249628a1f14773f747d93ec5fab70d0..3bef6c90fbc9f62ab43232f2f5926c3e3cc3cbdd 100644 (file)
@@ -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,