Merge branch 'embassy-rs:main' into can-split

This commit is contained in:
schphil
2023-06-23 10:19:30 +02:00
committed by GitHub
33 changed files with 3723 additions and 294 deletions

View File

@ -120,7 +120,6 @@ impl Ipcc {
let regs = IPCC::regs();
Self::flush(channel).await;
compiler_fence(Ordering::SeqCst);
f();
@ -136,7 +135,7 @@ impl Ipcc {
// This is a race, but is nice for debugging
if regs.cpu(0).sr().read().chf(channel as usize) {
trace!("ipcc: ch {}: wait for tx free", channel as u8);
trace!("ipcc: ch {}: wait for tx free", channel as u8);
}
poll_fn(|cx| {
@ -165,7 +164,7 @@ impl Ipcc {
loop {
// This is a race, but is nice for debugging
if !regs.cpu(1).sr().read().chf(channel as usize) {
trace!("ipcc: ch {}: wait for rx occupied", channel as u8);
trace!("ipcc: ch {}: wait for rx occupied", channel as u8);
}
poll_fn(|cx| {
@ -186,8 +185,7 @@ impl Ipcc {
})
.await;
trace!("ipcc: ch {}: read data", channel as u8);
compiler_fence(Ordering::SeqCst);
trace!("ipcc: ch {}: read data", channel as u8);
match f() {
Some(ret) => return ret,
@ -237,7 +235,7 @@ pub(crate) mod sealed {
}
}
pub fn rx_waker_for(&self, channel: IpccChannel) -> &AtomicWaker {
pub const fn rx_waker_for(&self, channel: IpccChannel) -> &AtomicWaker {
match channel {
IpccChannel::Channel1 => &self.rx_wakers[0],
IpccChannel::Channel2 => &self.rx_wakers[1],
@ -248,7 +246,7 @@ pub(crate) mod sealed {
}
}
pub fn tx_waker_for(&self, channel: IpccChannel) -> &AtomicWaker {
pub const fn tx_waker_for(&self, channel: IpccChannel) -> &AtomicWaker {
match channel {
IpccChannel::Channel1 => &self.tx_wakers[0],
IpccChannel::Channel2 => &self.tx_wakers[1],