[][src]Macro bbqueue::bbq

macro_rules! bbq {
    ($expr:expr) => { ... };
}

Statically allocate a BBQueue singleton object with a given size (in bytes).

This function must only ever be called once in the same place per function. For example:

This example is not tested
// this creates two separate/distinct buffers, and is an acceptable usage
let bbq1 = bbq!(1024).unwrap(); // Returns Some(BBQueue)
let bbq2 = bbq!(1024).unwrap(); // Returns Some(BBQueue)

// this is a bad example, as the same instance is executed twice!
// On the first call, this macro will return `Some(BBQueue)`. On the
// second call, this macro will return `None`!
for _ in 0..2 {
    let _ = bbq!(1024).unwrap();
}

If you are using this in a cortex-m microcontroller system, consider using the cortex_m_bbq!() macro instead.