Turn CC13xx RF back off after prop TX if it was off to start with

This commit is contained in:
George Oikonomou 2015-11-09 13:49:26 +00:00
parent e0e20aa3fd
commit 320a753666

View file

@ -647,6 +647,7 @@ static int
transmit(unsigned short transmit_len) transmit(unsigned short transmit_len)
{ {
int ret; int ret;
uint8_t was_off = 0;
uint32_t cmd_status; uint32_t cmd_status;
volatile rfc_CMD_PROP_TX_ADV_t *cmd_tx_adv; volatile rfc_CMD_PROP_TX_ADV_t *cmd_tx_adv;
@ -654,6 +655,7 @@ transmit(unsigned short transmit_len)
uint16_t total_length; uint16_t total_length;
if(!rf_is_on()) { if(!rf_is_on()) {
was_off = 1;
if(on() != RF_CORE_CMD_OK) { if(on() != RF_CORE_CMD_OK) {
PRINTF("transmit: on() failed\n"); PRINTF("transmit: on() failed\n");
return RADIO_TX_ERR; return RADIO_TX_ERR;
@ -739,6 +741,10 @@ transmit(unsigned short transmit_len)
rx_on_prop(); rx_on_prop();
if(was_off) {
off();
}
return ret; return ret;
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/