mirror of
https://github.com/rust-embedded/heapless.git
synced 2025-09-28 04:50:34 +00:00

This commit implements a new, simplified, SPSC that does not have the reported issues (e.g. not properly wrapping the indexes for non powers-of-2), and the support for multiple different index sizes has been removed for simplicity.
10 lines
166 B
Rust
10 lines
166 B
Rust
use heapless::spsc::Queue;
|
|
|
|
fn main() {
|
|
let mut q: Queue<u8, 4> = Queue::new();
|
|
|
|
let (_p, mut _c) = q.split();
|
|
q.enqueue(0).unwrap();
|
|
_c.dequeue();
|
|
}
|