entry

Attribute Macro entry 

Source
#[entry]
Expand description

Attribute to declare the entry point of the program

The specified function will be called by the reset handler after RAM has been initialized.

The type of the specified function must be [unsafe] fn() -> ! (never ending function)

The entry point will be called by the reset handler. The program can’t reference to the entry point, much less invoke it.

static mut variables declared within the entry function are safe to access and can be used to preserve state across invocations of the handler. The compiler can’t prove this is safe so the attribute will help by making a transformation to the source code: for this reason a variable like static mut FOO: u32 will be accessible from within the entry function as let FOO: &mut u32;.

§Example

#[entry]
fn main() -> ! {
    loop {
        /* .. */
    }
}