macro_rules! use_os_timer {
    (unsafe impl PortTimer for $Traits:ty) => { ... };
}
Expand description

Attach the implementation of PortTimer that is based on RZ/A1 OS Timer to a given kernel trait type. This macro also implements Timer on the kernel trait type. Requires OsTimerOptions and Gic.

You should do the following:

  • Implement OsTimerOptions on the kernel trait type $Traits.
  • Call $Traits::configure_os_timer() in your configuration function. See the following example.
r3_support_rza1::use_os_timer!(unsafe impl PortTimer for SystemTraits);

impl r3_support_rza1::OsTimerOptions for SystemTraits {
    const FREQUENCY: u64 = 1_000_000;
}

const fn configure_app(b: &mut Cfg<C>) -> Objects
where
    C: ~const traits::CfgBase<System = System<SystemTraits>>,
{
    SystemTraits::configure_os_timer(b);
    /* ... */
}

Safety

  • OsTimerOptions must be configured correctly.