mirror of
https://github.com/oliverschmidt/contiki.git
synced 2025-01-20 01:30:07 +00:00
Merge pull request #1370 from g-oikonomou/contrib/cc13xx/prop-mode
Improve the CC13xx sub-ghz driver
This commit is contained in:
commit
9effff6526
@ -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;
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
@ -971,6 +977,8 @@ off(void)
|
|||||||
rx_off_prop();
|
rx_off_prop();
|
||||||
rf_core_power_down();
|
rf_core_power_down();
|
||||||
|
|
||||||
|
ENERGEST_OFF(ENERGEST_TYPE_LISTEN);
|
||||||
|
|
||||||
/* Switch HF clock source to the RCOSC to preserve power */
|
/* Switch HF clock source to the RCOSC to preserve power */
|
||||||
oscillators_switch_to_hf_rc();
|
oscillators_switch_to_hf_rc();
|
||||||
|
|
||||||
@ -1058,6 +1066,12 @@ set_value(radio_param_t param, radio_value_t value)
|
|||||||
return RADIO_RESULT_INVALID_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);
|
set_channel((uint8_t)value);
|
||||||
break;
|
break;
|
||||||
case RADIO_PARAM_TXPOWER:
|
case RADIO_PARAM_TXPOWER:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user