Merge pull request #1370 from g-oikonomou/contrib/cc13xx/prop-mode

Improve the CC13xx sub-ghz driver
This commit is contained in:
Fredrik Österlind 2015-11-20 16:30:34 +01:00
commit 9effff6526

View file

@ -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;
}
/*---------------------------------------------------------------------------*/
@ -971,6 +977,8 @@ off(void)
rx_off_prop();
rf_core_power_down();
ENERGEST_OFF(ENERGEST_TYPE_LISTEN);
/* Switch HF clock source to the RCOSC to preserve power */
oscillators_switch_to_hf_rc();
@ -1058,6 +1066,12 @@ set_value(radio_param_t param, radio_value_t value)
return RADIO_RESULT_INVALID_VALUE;
}
if(get_channel() == (uint8_t)value) {
/* We already have that very same channel configured.
* Nothing to do here. */
return RADIO_RESULT_OK;
}
set_channel((uint8_t)value);
break;
case RADIO_PARAM_TXPOWER: