energest: replaced some energest on/off with ENERGEST_SWITCH()
This commit is contained in:
parent
7317316942
commit
fafe4bb1f3
@ -638,8 +638,7 @@ transmit(unsigned short transmit_len)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Start the transmission */
|
/* Start the transmission */
|
||||||
ENERGEST_OFF(ENERGEST_TYPE_LISTEN);
|
ENERGEST_SWITCH(ENERGEST_TYPE_LISTEN, ENERGEST_TYPE_TRANSMIT);
|
||||||
ENERGEST_ON(ENERGEST_TYPE_TRANSMIT);
|
|
||||||
|
|
||||||
CC2538_RF_CSP_ISTXON();
|
CC2538_RF_CSP_ISTXON();
|
||||||
|
|
||||||
@ -658,8 +657,7 @@ transmit(unsigned short transmit_len)
|
|||||||
while(REG(RFCORE_XREG_FSMSTAT1) & RFCORE_XREG_FSMSTAT1_TX_ACTIVE);
|
while(REG(RFCORE_XREG_FSMSTAT1) & RFCORE_XREG_FSMSTAT1_TX_ACTIVE);
|
||||||
ret = RADIO_TX_OK;
|
ret = RADIO_TX_OK;
|
||||||
}
|
}
|
||||||
ENERGEST_OFF(ENERGEST_TYPE_TRANSMIT);
|
ENERGEST_SWITCH(ENERGEST_TYPE_TRANSMIT, ENERGEST_TYPE_LISTEN);
|
||||||
ENERGEST_ON(ENERGEST_TYPE_LISTEN);
|
|
||||||
|
|
||||||
if(was_off) {
|
if(was_off) {
|
||||||
off();
|
off();
|
||||||
|
@ -946,8 +946,7 @@ transmit(unsigned short transmit_len)
|
|||||||
|
|
||||||
if(ret) {
|
if(ret) {
|
||||||
/* If we enter here, TX actually started */
|
/* If we enter here, TX actually started */
|
||||||
ENERGEST_OFF(ENERGEST_TYPE_LISTEN);
|
ENERGEST_SWITCH(ENERGEST_TYPE_LISTEN, ENERGEST_TYPE_TRANSMIT);
|
||||||
ENERGEST_ON(ENERGEST_TYPE_TRANSMIT);
|
|
||||||
|
|
||||||
/* Idle away while the command is running */
|
/* Idle away while the command is running */
|
||||||
while((cmd.status & RF_CORE_RADIO_OP_MASKED_STATUS)
|
while((cmd.status & RF_CORE_RADIO_OP_MASKED_STATUS)
|
||||||
@ -985,8 +984,7 @@ transmit(unsigned short transmit_len)
|
|||||||
* Update ENERGEST state here, before a potential call to off(), which
|
* Update ENERGEST state here, before a potential call to off(), which
|
||||||
* will correctly update it if required.
|
* will correctly update it if required.
|
||||||
*/
|
*/
|
||||||
ENERGEST_OFF(ENERGEST_TYPE_TRANSMIT);
|
ENERGEST_SWITCH(ENERGEST_TYPE_TRANSMIT, ENERGEST_TYPE_LISTEN);
|
||||||
ENERGEST_ON(ENERGEST_TYPE_LISTEN);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Disable LAST_FG_COMMAND_DONE interrupt. We don't really care about it
|
* Disable LAST_FG_COMMAND_DONE interrupt. We don't really care about it
|
||||||
|
@ -706,8 +706,7 @@ transmit(unsigned short transmit_len)
|
|||||||
|
|
||||||
if(ret) {
|
if(ret) {
|
||||||
/* If we enter here, TX actually started */
|
/* If we enter here, TX actually started */
|
||||||
ENERGEST_OFF(ENERGEST_TYPE_LISTEN);
|
ENERGEST_SWITCH(ENERGEST_TYPE_LISTEN, ENERGEST_TYPE_TRANSMIT);
|
||||||
ENERGEST_ON(ENERGEST_TYPE_TRANSMIT);
|
|
||||||
|
|
||||||
watchdog_periodic();
|
watchdog_periodic();
|
||||||
|
|
||||||
@ -737,8 +736,7 @@ transmit(unsigned short transmit_len)
|
|||||||
* Update ENERGEST state here, before a potential call to off(), which
|
* Update ENERGEST state here, before a potential call to off(), which
|
||||||
* will correctly update it if required.
|
* will correctly update it if required.
|
||||||
*/
|
*/
|
||||||
ENERGEST_OFF(ENERGEST_TYPE_TRANSMIT);
|
ENERGEST_SWITCH(ENERGEST_TYPE_TRANSMIT, ENERGEST_TYPE_LISTEN);
|
||||||
ENERGEST_ON(ENERGEST_TYPE_LISTEN);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Disable LAST_FG_COMMAND_DONE interrupt. We don't really care about it
|
* Disable LAST_FG_COMMAND_DONE interrupt. We don't really care about it
|
||||||
|
@ -1970,8 +1970,7 @@ idle_tx_rx(const uint8_t *payload, uint16_t payload_len)
|
|||||||
|
|
||||||
TX_LEDS_OFF();
|
TX_LEDS_OFF();
|
||||||
|
|
||||||
ENERGEST_OFF(ENERGEST_TYPE_TRANSMIT);
|
ENERGEST_SWITCH(ENERGEST_TYPE_TRANSMIT, ENERGEST_TYPE_LISTEN);
|
||||||
ENERGEST_ON(ENERGEST_TYPE_LISTEN);
|
|
||||||
|
|
||||||
return RADIO_TX_OK;
|
return RADIO_TX_OK;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user