mirror of
https://github.com/oliverschmidt/contiki.git
synced 2024-12-23 01:29:33 +00:00
fixed error in saving status
This commit is contained in:
parent
37def294ce
commit
be9879cf18
@ -964,17 +964,18 @@ PROCESS_THREAD(cc2538_rf_process, ev, data)
|
|||||||
|
|
||||||
/* If we were polled due to an RF error, reset the transceiver */
|
/* If we were polled due to an RF error, reset the transceiver */
|
||||||
if(rf_flags & RF_MUST_RESET) {
|
if(rf_flags & RF_MUST_RESET) {
|
||||||
|
uint8_t was_on;
|
||||||
rf_flags = 0;
|
rf_flags = 0;
|
||||||
|
|
||||||
/* save state so we know if to switch on again after re-init */
|
/* save state so we know if to switch on again after re-init */
|
||||||
if((REG(RFCORE_XREG_FSMSTAT0) & RFCORE_XREG_FSMSTAT0_FSM_FFCTRL_STATE) == 0) {
|
if((REG(RFCORE_XREG_FSMSTAT0) & RFCORE_XREG_FSMSTAT0_FSM_FFCTRL_STATE) == 0) {
|
||||||
rf_flags |= WAS_OFF;
|
was_on = 0;
|
||||||
} else {
|
} else {
|
||||||
rf_flags &= ~WAS_OFF;
|
was_on = 1;
|
||||||
}
|
}
|
||||||
off();
|
off();
|
||||||
init();
|
init();
|
||||||
if ((rf_flags & WAS_OFF) != WAS_OFF) {
|
if (was_on) {
|
||||||
/* switch back on */
|
/* switch back on */
|
||||||
on();
|
on();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user