new_xtensa in shared_bus - Rust (original) (raw)

macro_rules! new_xtensa {
    ($bus_type:ty = $bus:expr) => { ... };
}

Expand description

Macro for creating a Xtensa-lx6 bus manager with 'static lifetime.

This macro is a convenience helper for creating a bus manager that lives for the 'staticlifetime an thus can be safely shared across tasks/execution contexts (like interrupts).

This macro is only available with the xtensa feature.

§Syntax

let bus = shared_bus::new_xtensa!(<Full Bus Type Signature> = <bus>).unwrap();

The macro returns an Option which will be Some(&'static bus_manager) on the first run andNone afterwards. This is necessary to uphold safety around the inner static variable.