From 320a753666c4ca8795b205b7b18ce599a1d0e3d8 Mon Sep 17 00:00:00 2001 From: George Oikonomou Date: Mon, 9 Nov 2015 13:49:26 +0000 Subject: [PATCH] Turn CC13xx RF back off after prop TX if it was off to start with --- cpu/cc26xx-cc13xx/rf-core/prop-mode.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cpu/cc26xx-cc13xx/rf-core/prop-mode.c b/cpu/cc26xx-cc13xx/rf-core/prop-mode.c index a3ab8e171..10bcbd00e 100644 --- a/cpu/cc26xx-cc13xx/rf-core/prop-mode.c +++ b/cpu/cc26xx-cc13xx/rf-core/prop-mode.c @@ -647,6 +647,7 @@ static int transmit(unsigned short transmit_len) { int ret; + uint8_t was_off = 0; uint32_t cmd_status; volatile rfc_CMD_PROP_TX_ADV_t *cmd_tx_adv; @@ -654,6 +655,7 @@ transmit(unsigned short transmit_len) uint16_t total_length; if(!rf_is_on()) { + was_off = 1; if(on() != RF_CORE_CMD_OK) { PRINTF("transmit: on() failed\n"); return RADIO_TX_ERR; @@ -739,6 +741,10 @@ transmit(unsigned short transmit_len) rx_on_prop(); + if(was_off) { + off(); + } + return ret; } /*---------------------------------------------------------------------------*/