diff --git a/embassy/src/util/mpsc.rs b/embassy/src/util/mpsc.rs index c409161f8..f350c6e53 100644 --- a/embassy/src/util/mpsc.rs +++ b/embassy/src/util/mpsc.rs @@ -563,7 +563,7 @@ pub struct Channel where M: Mutex, { - sync_channel: UnsafeCell>, + channel_cell: UnsafeCell>, } struct ChannelCell @@ -593,9 +593,9 @@ impl Channel { pub const fn with_critical_sections() -> Self { let mutex = CriticalSectionMutex::new(()); let state = ChannelState::new(); - let sync_channel = ChannelCell { mutex, state }; + let channel_cell = ChannelCell { mutex, state }; Channel { - sync_channel: UnsafeCell::new(sync_channel), + channel_cell: UnsafeCell::new(channel_cell), } } } @@ -620,9 +620,9 @@ impl Channel { pub const fn with_thread_mode_only() -> Self { let mutex = ThreadModeMutex::new(()); let state = ChannelState::new(); - let sync_channel = ChannelCell { mutex, state }; + let channel_cell = ChannelCell { mutex, state }; Channel { - sync_channel: UnsafeCell::new(sync_channel), + channel_cell: UnsafeCell::new(channel_cell), } } } @@ -644,9 +644,9 @@ impl Channel { pub const fn with_no_threads() -> Self { let mutex = NoopMutex::new(()); let state = ChannelState::new(); - let sync_channel = ChannelCell { mutex, state }; + let channel_cell = ChannelCell { mutex, state }; Channel { - sync_channel: UnsafeCell::new(sync_channel), + channel_cell: UnsafeCell::new(channel_cell), } } } @@ -657,9 +657,9 @@ where { fn lock(&self, f: impl FnOnce(&mut ChannelState) -> R) -> R { unsafe { - let sync_channel = &mut *(self.sync_channel.get()); - let mutex = &mut sync_channel.mutex; - let mut state = &mut sync_channel.state; + let channel_cell = &mut *(self.channel_cell.get()); + let mutex = &mut channel_cell.mutex; + let mut state = &mut channel_cell.state; mutex.lock(|_| f(&mut state)) } }