aboutsummaryrefslogtreecommitdiff
path: root/embassy-stm32
diff options
context:
space:
mode:
authorxoviat <[email protected]>2023-06-21 21:50:12 +0000
committerGitHub <[email protected]>2023-06-21 21:50:12 +0000
commit1f2be2dac5eeed739d2866b9b63ca06fdd84c276 (patch)
treefd97bffac5ab4f754d9fd48d7ac8b95054a1d046 /embassy-stm32
parent2e625138ff8384a96f1f8a4d7a9c557b50353836 (diff)
parent5247c1c795a8b37be485aeeaa99a79eece678fba (diff)
Merge pull request #1569 from xoviat/tl-mbox-2
wpan: misc. cleanup and add mac
Diffstat (limited to 'embassy-stm32')
-rw-r--r--embassy-stm32/src/ipcc.rs12
1 files changed, 5 insertions, 7 deletions
diff --git a/embassy-stm32/src/ipcc.rs b/embassy-stm32/src/ipcc.rs
index 3062226c7..37f840c73 100644
--- a/embassy-stm32/src/ipcc.rs
+++ b/embassy-stm32/src/ipcc.rs
@@ -120,7 +120,6 @@ impl Ipcc {
120 let regs = IPCC::regs(); 120 let regs = IPCC::regs();
121 121
122 Self::flush(channel).await; 122 Self::flush(channel).await;
123 compiler_fence(Ordering::SeqCst);
124 123
125 f(); 124 f();
126 125
@@ -136,7 +135,7 @@ impl Ipcc {
136 135
137 // This is a race, but is nice for debugging 136 // This is a race, but is nice for debugging
138 if regs.cpu(0).sr().read().chf(channel as usize) { 137 if regs.cpu(0).sr().read().chf(channel as usize) {
139 trace!("ipcc: ch {}: wait for tx free", channel as u8); 138 trace!("ipcc: ch {}: wait for tx free", channel as u8);
140 } 139 }
141 140
142 poll_fn(|cx| { 141 poll_fn(|cx| {
@@ -165,7 +164,7 @@ impl Ipcc {
165 loop { 164 loop {
166 // This is a race, but is nice for debugging 165 // This is a race, but is nice for debugging
167 if !regs.cpu(1).sr().read().chf(channel as usize) { 166 if !regs.cpu(1).sr().read().chf(channel as usize) {
168 trace!("ipcc: ch {}: wait for rx occupied", channel as u8); 167 trace!("ipcc: ch {}: wait for rx occupied", channel as u8);
169 } 168 }
170 169
171 poll_fn(|cx| { 170 poll_fn(|cx| {
@@ -186,8 +185,7 @@ impl Ipcc {
186 }) 185 })
187 .await; 186 .await;
188 187
189 trace!("ipcc: ch {}: read data", channel as u8); 188 trace!("ipcc: ch {}: read data", channel as u8);
190 compiler_fence(Ordering::SeqCst);
191 189
192 match f() { 190 match f() {
193 Some(ret) => return ret, 191 Some(ret) => return ret,
@@ -237,7 +235,7 @@ pub(crate) mod sealed {
237 } 235 }
238 } 236 }
239 237
240 pub fn rx_waker_for(&self, channel: IpccChannel) -> &AtomicWaker { 238 pub const fn rx_waker_for(&self, channel: IpccChannel) -> &AtomicWaker {
241 match channel { 239 match channel {
242 IpccChannel::Channel1 => &self.rx_wakers[0], 240 IpccChannel::Channel1 => &self.rx_wakers[0],
243 IpccChannel::Channel2 => &self.rx_wakers[1], 241 IpccChannel::Channel2 => &self.rx_wakers[1],
@@ -248,7 +246,7 @@ pub(crate) mod sealed {
248 } 246 }
249 } 247 }
250 248
251 pub fn tx_waker_for(&self, channel: IpccChannel) -> &AtomicWaker { 249 pub const fn tx_waker_for(&self, channel: IpccChannel) -> &AtomicWaker {
252 match channel { 250 match channel {
253 IpccChannel::Channel1 => &self.tx_wakers[0], 251 IpccChannel::Channel1 => &self.tx_wakers[0],
254 IpccChannel::Channel2 => &self.tx_wakers[1], 252 IpccChannel::Channel2 => &self.tx_wakers[1],