Macro stm32_hal2::make_globals

source ·
macro_rules! make_globals {
    ($(($NAME:ident, $type:ty)),+ $(,)?) => { ... };
}
Expand description

Syntax helper for setting global variables of the form Mutex<RefCell<Option>>>. eg in interrupt handlers. Ideal for non-copy-type variables that can’t be initialized immediatiately.

Example: make_globals!( (USB_SERIAL, SerialPort<UsbBusType>), (DELAY, Delay), )