Macro r3_port_arm_m::use_systick_tickful
source · macro_rules! use_systick_tickful { (unsafe impl PortTimer for $Traits:ty) => { ... }; }
Expand description
Attach the tickful implementation of PortTimer
that is based on SysTick
to a given kernel trait type.
You should also do the following:
- Implement
SysTickOptions
manually. - Call
$Traits::configure_systick()
in your configuration function. See the following example.
ⓘ
r3_port_arm_m::use_systick_tickful!(unsafe impl PortTimer for SystemTraits);
impl r3_port_arm_m::SysTickOptions for SystemTraits {
// SysTick = AHB/8, AHB = HSI (internal 16-MHz RC oscillator)
const FREQUENCY: u64 = 2_000_000;
}
const fn configure_app(b: &mut r3_kernel::Cfg<SystemTraits>) -> Objects {
SystemTraits::configure_systick(b);
/* ... */
}
Safety
- The target must really be a bare-metal Arm-M environment.