diff options
Diffstat (limited to 'embassy-stm32-wpan/src/mac/runner.rs')
| -rw-r--r-- | embassy-stm32-wpan/src/mac/runner.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/embassy-stm32-wpan/src/mac/runner.rs b/embassy-stm32-wpan/src/mac/runner.rs index acca70019..3b7d895df 100644 --- a/embassy-stm32-wpan/src/mac/runner.rs +++ b/embassy-stm32-wpan/src/mac/runner.rs | |||
| @@ -24,11 +24,11 @@ pub struct Runner<'a> { | |||
| 24 | // therefore, we don't need to worry about overwriting events | 24 | // therefore, we don't need to worry about overwriting events |
| 25 | rx_event_channel: &'a ZeroCopyPubSub<CriticalSectionRawMutex, MacEvent<'a>>, | 25 | rx_event_channel: &'a ZeroCopyPubSub<CriticalSectionRawMutex, MacEvent<'a>>, |
| 26 | rx_data_channel: &'a Channel<CriticalSectionRawMutex, MacEvent<'a>, 1>, | 26 | rx_data_channel: &'a Channel<CriticalSectionRawMutex, MacEvent<'a>, 1>, |
| 27 | mac_rx: &'a mut MacRx, | 27 | mac_rx: Mutex<NoopRawMutex, &'a mut MacRx<'a>>, |
| 28 | 28 | ||
| 29 | tx_data_channel: &'a Channel<CriticalSectionRawMutex, (&'a mut [u8; MTU], usize), BUF_SIZE>, | 29 | tx_data_channel: &'a Channel<CriticalSectionRawMutex, (&'a mut [u8; MTU], usize), BUF_SIZE>, |
| 30 | tx_buf_channel: &'a Channel<CriticalSectionRawMutex, &'a mut [u8; MTU], BUF_SIZE>, | 30 | tx_buf_channel: &'a Channel<CriticalSectionRawMutex, &'a mut [u8; MTU], BUF_SIZE>, |
| 31 | mac_tx: &'a Mutex<CriticalSectionRawMutex, MacTx>, | 31 | mac_tx: &'a Mutex<CriticalSectionRawMutex, MacTx<'a>>, |
| 32 | 32 | ||
| 33 | #[allow(unused)] | 33 | #[allow(unused)] |
| 34 | network_state: &'a blocking_mutex::Mutex<CriticalSectionRawMutex, RefCell<NetworkState>>, | 34 | network_state: &'a blocking_mutex::Mutex<CriticalSectionRawMutex, RefCell<NetworkState>>, |
| @@ -38,10 +38,10 @@ impl<'a> Runner<'a> { | |||
| 38 | pub(crate) fn new( | 38 | pub(crate) fn new( |
| 39 | rx_event_channel: &'a ZeroCopyPubSub<CriticalSectionRawMutex, MacEvent<'a>>, | 39 | rx_event_channel: &'a ZeroCopyPubSub<CriticalSectionRawMutex, MacEvent<'a>>, |
| 40 | rx_data_channel: &'a Channel<CriticalSectionRawMutex, MacEvent<'a>, 1>, | 40 | rx_data_channel: &'a Channel<CriticalSectionRawMutex, MacEvent<'a>, 1>, |
| 41 | mac_rx: &'a mut MacRx, | 41 | mac_rx: &'a mut MacRx<'a>, |
| 42 | tx_data_channel: &'a Channel<CriticalSectionRawMutex, (&'a mut [u8; MTU], usize), BUF_SIZE>, | 42 | tx_data_channel: &'a Channel<CriticalSectionRawMutex, (&'a mut [u8; MTU], usize), BUF_SIZE>, |
| 43 | tx_buf_channel: &'a Channel<CriticalSectionRawMutex, &'a mut [u8; MTU], BUF_SIZE>, | 43 | tx_buf_channel: &'a Channel<CriticalSectionRawMutex, &'a mut [u8; MTU], BUF_SIZE>, |
| 44 | mac_tx: &'a Mutex<CriticalSectionRawMutex, MacTx>, | 44 | mac_tx: &'a Mutex<CriticalSectionRawMutex, MacTx<'a>>, |
| 45 | tx_buf_queue: &'a mut [[u8; MTU]; BUF_SIZE], | 45 | tx_buf_queue: &'a mut [[u8; MTU]; BUF_SIZE], |
| 46 | network_state: &'a blocking_mutex::Mutex<CriticalSectionRawMutex, RefCell<NetworkState>>, | 46 | network_state: &'a blocking_mutex::Mutex<CriticalSectionRawMutex, RefCell<NetworkState>>, |
| 47 | short_address: [u8; 2], | 47 | short_address: [u8; 2], |
| @@ -61,7 +61,7 @@ impl<'a> Runner<'a> { | |||
| 61 | Self { | 61 | Self { |
| 62 | rx_event_channel, | 62 | rx_event_channel, |
| 63 | rx_data_channel, | 63 | rx_data_channel, |
| 64 | mac_rx, | 64 | mac_rx: Mutex::new(mac_rx), |
| 65 | tx_data_channel, | 65 | tx_data_channel, |
| 66 | tx_buf_channel, | 66 | tx_buf_channel, |
| 67 | mac_tx, | 67 | mac_tx, |
| @@ -83,7 +83,7 @@ impl<'a> Runner<'a> { | |||
| 83 | join::join( | 83 | join::join( |
| 84 | async { | 84 | async { |
| 85 | loop { | 85 | loop { |
| 86 | if let Ok(mac_event) = self.mac_rx.read().await { | 86 | if let Ok(mac_event) = self.mac_rx.try_lock().unwrap().read().await { |
| 87 | match mac_event { | 87 | match mac_event { |
| 88 | MacEvent::MlmeAssociateCnf(_) | 88 | MacEvent::MlmeAssociateCnf(_) |
| 89 | | MacEvent::MlmeDisassociateCnf(_) | 89 | | MacEvent::MlmeDisassociateCnf(_) |
