revert module changes, reexport heapless relevant items
This commit is contained in:
parent
5a60024af7
commit
454828accb
3 changed files with 6 additions and 8 deletions
|
@ -29,8 +29,6 @@ use crate::blocking_mutex::raw::RawMutex;
|
|||
use crate::blocking_mutex::Mutex;
|
||||
use crate::waitqueue::WakerRegistration;
|
||||
|
||||
pub mod priority;
|
||||
|
||||
/// Send-only access to a [`Channel`].
|
||||
pub struct Sender<'ch, M, T, const N: usize>
|
||||
where
|
||||
|
@ -78,7 +76,7 @@ where
|
|||
|
||||
/// Send-only access to a [`Channel`] without knowing channel size.
|
||||
pub struct DynamicSender<'ch, T> {
|
||||
channel: &'ch dyn DynamicChannel<T>,
|
||||
pub(crate) channel: &'ch dyn DynamicChannel<T>,
|
||||
}
|
||||
|
||||
impl<'ch, T> Clone for DynamicSender<'ch, T> {
|
||||
|
@ -178,7 +176,7 @@ where
|
|||
|
||||
/// Receive-only access to a [`Channel`] without knowing channel size.
|
||||
pub struct DynamicReceiver<'ch, T> {
|
||||
channel: &'ch dyn DynamicChannel<T>,
|
||||
pub(crate) channel: &'ch dyn DynamicChannel<T>,
|
||||
}
|
||||
|
||||
impl<'ch, T> Clone for DynamicReceiver<'ch, T> {
|
||||
|
@ -323,7 +321,7 @@ impl<'ch, T> Future for DynamicSendFuture<'ch, T> {
|
|||
|
||||
impl<'ch, T> Unpin for DynamicSendFuture<'ch, T> {}
|
||||
|
||||
trait DynamicChannel<T> {
|
||||
pub(crate) trait DynamicChannel<T> {
|
||||
fn try_send_with_context(&self, message: T, cx: Option<&mut Context<'_>>) -> Result<(), TrySendError<T>>;
|
||||
|
||||
fn try_receive_with_context(&self, cx: Option<&mut Context<'_>>) -> Result<T, TryReceiveError>;
|
||||
|
|
|
@ -15,6 +15,7 @@ pub mod blocking_mutex;
|
|||
pub mod channel;
|
||||
pub mod mutex;
|
||||
pub mod pipe;
|
||||
pub mod priority_channel;
|
||||
pub mod pubsub;
|
||||
pub mod signal;
|
||||
pub mod waitqueue;
|
||||
|
|
|
@ -8,7 +8,7 @@ use core::future::Future;
|
|||
use core::pin::Pin;
|
||||
use core::task::{Context, Poll};
|
||||
|
||||
use heapless::binary_heap::Kind;
|
||||
pub use heapless::binary_heap::{Kind, Max, Min};
|
||||
use heapless::BinaryHeap;
|
||||
|
||||
use crate::blocking_mutex::raw::RawMutex;
|
||||
|
@ -344,8 +344,7 @@ where
|
|||
/// Establish a new bounded channel. For example, to create one with a NoopMutex:
|
||||
///
|
||||
/// ```
|
||||
/// # use heapless::binary_heap::Max;
|
||||
/// use embassy_sync::channel::priority::PriorityChannel;
|
||||
/// use embassy_sync::priority_channel::{PriorityChannel, Max};
|
||||
/// use embassy_sync::blocking_mutex::raw::NoopRawMutex;
|
||||
///
|
||||
/// // Declare a bounded channel of 3 u32s.
|
Loading…
Reference in a new issue