summaryrefslogtreecommitdiff
path: root/src/drivers/ao_m25.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2012-12-16 16:04:05 -0800
committerKeith Packard <keithp@keithp.com>2012-12-16 16:04:05 -0800
commit22a58b0f9b82ea8c7abeda79ca7a4cd21c3dc93c (patch)
treeb7e3bae3670fc0e4b55571f3ea9abee48bf841ee /src/drivers/ao_m25.c
parent4e3ac3f2038cc3a43252fc8f820a1373a637ab83 (diff)
altos: Wire up another CC1120 GPIO to get MARC status changes
When the radio drops out of RX or TX mode due to an error, it changes the MARC status, and sends pulse down a configured GPIO. Use this to tell when something 'bad' happened during TX or RX so that we can recover from losing the SPI bus in the middle of transmission or reception. Without this, the radio would change state and we'd never know, leaving the radio code waiting for an interrupt that would never arrive. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/drivers/ao_m25.c')
-rw-r--r--src/drivers/ao_m25.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/src/drivers/ao_m25.c b/src/drivers/ao_m25.c
index 518765b2..9f696ace 100644
--- a/src/drivers/ao_m25.c
+++ b/src/drivers/ao_m25.c
@@ -99,19 +99,7 @@ static __xdata uint8_t ao_m25_mutex;
static __xdata uint8_t ao_m25_instruction[4];
-#if HAS_BOOT_RADIO
-/* Kick any radio listeners off so the flash can be written */
-extern uint8_t ao_radio_in_recv;
-
-static void ao_boot_radio(void) {
- if (ao_radio_in_recv)
- ao_radio_recv_abort();
-}
-#else
-#define ao_boot_radio()
-#endif
-
-#define M25_SELECT(cs) do { ao_boot_radio(); ao_spi_get_mask(AO_M25_SPI_CS_PORT,cs,AO_M25_SPI_BUS, AO_SPI_SPEED_FAST); } while (0)
+#define M25_SELECT(cs) ao_spi_get_mask(AO_M25_SPI_CS_PORT,cs,AO_M25_SPI_BUS, AO_SPI_SPEED_FAST)
#define M25_DESELECT(cs) ao_spi_put_mask(AO_M25_SPI_CS_PORT,cs,AO_M25_SPI_BUS)
#define M25_BLOCK_SHIFT 16