pub struct QueueSet3<'a, T0, T1, T2>where
T0: Copy,
T1: Copy,
T2: Copy,{ /* private fields */ }Expand description
A FreeRTOS queue set that monitors a fixed number of queues of (potentially) different item types.
Construct with new, then call select_from_set to block
until any member queue has an item ready. The item is
automatically received and returned inside the typed enum.
§FreeRTOS constraints
- All queues must be empty when
newis called. - A queue may only belong to one queue set at a time.
- The combined capacity of all queues must not be zero.
Implementations§
Source§impl<'a, T0, T1, T2> QueueSet3<'a, T0, T1, T2>where
T0: Copy,
T1: Copy,
T2: Copy,
impl<'a, T0, T1, T2> QueueSet3<'a, T0, T1, T2>where
T0: Copy,
T1: Copy,
T2: Copy,
Sourcepub fn new(
q0: &'a Queue<T0>,
q1: &'a Queue<T1>,
q2: &'a Queue<T2>,
) -> Result<Self, EspError>
pub fn new( q0: &'a Queue<T0>, q1: &'a Queue<T1>, q2: &'a Queue<T2>, ) -> Result<Self, EspError>
Create a new queue set monitoring all supplied queues.
The FreeRTOS event-queue length is computed as the sum of the capacities of all member queues. All queues must be empty at the time of the call. On failure (queue not empty, already in a set, etc.) all previously added queues are removed and the set handle is deleted before returning the error.
Sourcepub fn select_from_set(
&self,
timeout: TickType_t,
) -> Option<QueueSet3Selected<T0, T1, T2>>
pub fn select_from_set( &self, timeout: TickType_t, ) -> Option<QueueSet3Selected<T0, T1, T2>>
Block until one of the member queues has an item available,
or until timeout ticks elapse.
On success the item is automatically received from the
ready queue and returned inside the enum variant.
Returns None on timeout.
§ISR safety
Dispatches to xQueueSelectFromSetFromISR when called from
an ISR context, otherwise uses xQueueSelectFromSet.