[][src]Function cortex_m_rt_macros::pre_init

pub fn pre_init(args: TokenStream, input: TokenStream) -> TokenStream

Attribute to mark which function will be called at the beginning of the reset handler.

IMPORTANT: This attribute must be used once in the dependency graph and must be used on a reachable item (i.e. there must be no private modules between the item and the root of the crate). If the item is in the root of the crate you'll be fine.

The function must have the signature of unsafe fn().

The function passed will be called before static variables are initialized. Any access of static variables will result in undefined behavior.

Examples

#[pre_init]
unsafe fn before_main() {
    // do something here
}