From 65c24e6315981b10720bf098d56a0aaf36534a66 Mon Sep 17 00:00:00 2001 From: Erik Gustavsson Date: Tue, 17 Feb 2015 18:08:47 +0100 Subject: [PATCH] OP-1691 Release SPI bus before sleeping --- flight/pios/common/pios_rfm22b.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/flight/pios/common/pios_rfm22b.c b/flight/pios/common/pios_rfm22b.c index 2faee1b35..9489adc36 100644 --- a/flight/pios/common/pios_rfm22b.c +++ b/flight/pios/common/pios_rfm22b.c @@ -1474,9 +1474,15 @@ static enum pios_radio_event rfm22_init(struct pios_rfm22b_dev *rfm22b_dev) // x-nibbles rx preamble detection rfm22_write(rfm22b_dev, RFM22_preamble_detection_ctrl1, RX_PREAMBLE_NIBBLES << 3); + // Release the bus + rfm22_releaseBus(rfm22b_dev); + // Yield the CPU. vTaskDelay(1 + (1/(portTICK_RATE_MS+1))); + // Claim the SPI bus. + rfm22_claimBus(rfm22b_dev); + // header control - using a 4 by header with broadcast of 0xffffffff rfm22_write(rfm22b_dev, RFM22_header_control1, RFM22_header_cntl1_bcen_0 |