Macro def_static_resource

Source
macro_rules! def_static_resource {
    (RES, $ty: ty, $default: expr) => { ... };
}
Expand description

Defines a static resource of the specified type and default value, placing it in the custom linker section axns_resource.

§Parameters

  • $ty: The type of the static resource.
  • $default: The default value to initialize the resource with.

§Generated Items

  • A static variable RES of type $ty, initialized with $default.
  • A function res_ptr() that returns a raw pointer to the resource as *const u8.

§Example

def_static_resource!(u32, 0);