[][src]Macro r3_port_arm_m::use_systick_tickful

macro_rules! use_systick_tickful {
    (unsafe impl PortTimer for $ty:ty) => { ... };
}

Attach the tickful implementation of PortTimer that is based on SysTick to a given system type.

You should also do the following:

  • Implement SysTickOptions manually.
  • Call $ty::configure_systick() in your configuration function. See the following example.
This example is not tested
r3_port_arm_m::use_systick_tickful!(unsafe impl PortTimer for System);

impl r3_port_arm_m::SysTickOptions for System {
   // SysTick = AHB/8, AHB = HSI (internal 16-MHz RC oscillator)
    const FREQUENCY: u64 = 2_000_000;
}

const fn configure_app(b: &mut CfgBuilder<System>) -> Objects {
    System::configure_systick(b);
    /* ... */
}

Safety

  • The target must really be a bare-metal Arm-M environment.