From 1085ec5d57e0ed5d132f2bbdac1a0b6a32c0ab4a Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Tue, 5 Jul 2016 18:03:49 +0200 Subject: Switch from GPLv2 to GPLv2+ Signed-off-by: Keith Packard --- src/drivers/ao_cc1120.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/drivers/ao_cc1120.c') diff --git a/src/drivers/ao_cc1120.c b/src/drivers/ao_cc1120.c index 6b800585..da5bbeba 100644 --- a/src/drivers/ao_cc1120.c +++ b/src/drivers/ao_cc1120.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 -- cgit v1.2.3 From 2507b9f29d25f77de249103805087a704069c625 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Wed, 27 Jul 2016 13:17:51 -0700 Subject: altos: Don't access cc1120 SPI bus during recv after abort has started When the receive timeout happens, the radio may still interrupt while the SPI bus is getting shut down. If this happens, the interrupt handler shouldn't touch the SPI bus at all as it may well be turned off, which would cause the receive function to wedge waiting for a spi byte transfer to happen. Signed-off-by: Keith Packard --- src/drivers/ao_cc1120.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/drivers/ao_cc1120.c') diff --git a/src/drivers/ao_cc1120.c b/src/drivers/ao_cc1120.c index da5bbeba..f9fc6b2d 100644 --- a/src/drivers/ao_cc1120.c +++ b/src/drivers/ao_cc1120.c @@ -999,6 +999,8 @@ ao_radio_rx_isr(void) { uint8_t d; + if (ao_radio_abort) + return; if (rx_task_id) { if (ao_radio_try_select(rx_task_id)) { ++rx_fast_start; -- cgit v1.2.3 From ab75ab10564c4d5d05719c382a3b71585cd70710 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Mon, 29 Aug 2016 09:27:53 -0700 Subject: altos/cc1120: remove unused status from ao_radio_fifo_write_stop Signed-off-by: Keith Packard --- src/drivers/ao_cc1120.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'src/drivers/ao_cc1120.c') diff --git a/src/drivers/ao_cc1120.c b/src/drivers/ao_cc1120.c index f9fc6b2d..efe5f996 100644 --- a/src/drivers/ao_cc1120.c +++ b/src/drivers/ao_cc1120.c @@ -183,9 +183,8 @@ ao_radio_fifo_write_start(void) return status; } -static inline uint8_t ao_radio_fifo_write_stop(uint8_t status) { +static inline void ao_radio_fifo_write_stop(void) { ao_radio_deselect(); - return status; } static uint8_t @@ -193,7 +192,8 @@ ao_radio_fifo_write(uint8_t *data, uint8_t len) { uint8_t status = ao_radio_fifo_write_start(); ao_radio_spi_send(data, len); - return ao_radio_fifo_write_stop(status); + ao_radio_fifo_write_stop(); + return status; } static uint8_t @@ -201,7 +201,8 @@ ao_radio_fifo_write_fixed(uint8_t data, uint8_t len) { uint8_t status = ao_radio_fifo_write_start(); ao_radio_spi_send_fixed(data, len); - return ao_radio_fifo_write_stop(status); + ao_radio_fifo_write_stop(); + return status; } static uint8_t @@ -774,11 +775,10 @@ void ao_radio_continuity(uint8_t c) { uint8_t i; - uint8_t status; ao_rdf_start(AO_RADIO_CONT_TOTAL_LEN); - status = ao_radio_fifo_write_start(); + (void) ao_radio_fifo_write_start(); for (i = 0; i < 3; i++) { ao_radio_spi_send_fixed(0x00, AO_RADIO_CONT_PAUSE_LEN); if (i < c) @@ -787,8 +787,7 @@ ao_radio_continuity(uint8_t c) ao_radio_spi_send_fixed(0x00, AO_RADIO_CONT_TONE_LEN); } ao_radio_spi_send_fixed(0x00, AO_RADIO_CONT_PAUSE_LEN); - status = ao_radio_fifo_write_stop(status); - (void) status; + ao_radio_fifo_write_stop(); ao_rdf_run(); } -- cgit v1.2.3