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
PRIMASK
orSCB.VTOR
unless you know what you are doing. ::cortex_m_rt
should point to thecortex-m-rt
crate.- Other components should not execute the
svc
instruction. <$Traits as
ThreadingOptions
>::
interrupt_stack_top
must 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.