Module atmega32u4_hal::global[][src]

Global variable abstraction

Example

static MY_GLOBAL: atmega32u4_hal::Global<u64> = atmega32u4_hal::Global::new();

fn main() {
    MY_GLOBAL.set(0xC0FFEE);

    loop { }
}

interrupt!(INT1, int1_isr);
fn int1_isr() {
    MY_GLOBAL.get(|v| {
        // Do something
    }).expect("Interrupt fired before initialisation!");
}

Structs

Global

A global variable store