Macro r3_port_arm_m::use_port
source · macro_rules! use_port { (unsafe $vis:vis struct $Traits:ident) => { ... }; }
Expand description
Instantiate the port. Implements the port traits (PortThreading, etc.)
and EntryPoint.
This macro doesn’t provide an implementation of PortTimer, which you
must supply one through other ways.
See the crate-level documentation for possible
options.
Safety
- The target must really be a bare-metal Arm-M environment.
- You shouldn’t interfere with the port’s operrations. For example, you
shouldn’t manually modify
PRIMASKorSCB.VTORunless you know what you are doing. ::cortex_m_rtshould point to thecortex-m-rtcrate.- Other components should not execute the
svcinstruction. <$Traits asThreadingOptions>::interrupt_stack_topmust return a valid stack pointer. The default implementation evaluates*(SCB.VTOR a *const u32), which should be fine for most use cases, but if this is not acceptable, a custom implementation should be provided.