Skip to content

Commit f403aa1

Browse files
committed
ieee802154: handle the transitory state TXDISABLE
after PR #356 the radio is disabled after every `send` operation. if one calls `recv` immediately after `send`, `recv` can observe the radio in the TXDISABLE state TXDISABLE is a transitory state that leads to the final DISABLED state which the impl knows how to handle this PR adds logic to handle the transitory TXDISABLE state fixes #368
1 parent 52f6e0f commit f403aa1

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

nrf-hal-common/src/ieee802154.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -659,9 +659,17 @@ impl<'c> Radio<'c> {
659659

660660
fn state(&self) -> State {
661661
match self.radio.state.read().state().variant().unwrap() {
662+
// final states
662663
STATE_A::DISABLED => State::Disabled,
663664
STATE_A::TXIDLE => State::TxIdle,
664665
STATE_A::RXIDLE => State::RxIdle,
666+
667+
// transitory states
668+
STATE_A::TXDISABLE => {
669+
self.wait_for_state_a(STATE_A::DISABLED);
670+
State::Disabled
671+
}
672+
665673
_ => unreachable!(),
666674
}
667675
}

0 commit comments

Comments
 (0)