File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -206,7 +206,7 @@ impl Peripherals {
206206 MPU : MPU {
207207 _marker : PhantomData ,
208208 } ,
209- NVIC : NVIC ( nvic :: RegisterBlock :: new ( ) ) ,
209+ NVIC : NVIC :: steal ( ) ,
210210 SAU : SAU {
211211 _marker : PhantomData ,
212212 } ,
@@ -545,8 +545,9 @@ impl NVIC {
545545 ///
546546 /// This potentially allows to create multiple instances of the NVIC register block, which
547547 /// might only be valid in certain multi-core environments.
548+ #[ inline]
548549 pub unsafe fn steal ( ) -> Self {
549- NVIC ( unsafe { nvic:: RegisterBlock :: new ( ) } )
550+ NVIC ( unsafe { nvic:: RegisterBlock :: new_mmio_fixed ( ) } )
550551 }
551552}
552553
Original file line number Diff line number Diff line change 22use crate :: interrupt:: InterruptNumber ;
33use crate :: peripheral:: NVIC ;
44
5+ /// NVIC base address.
6+ pub const BASE_ADDRESS : usize = 0xE000_E100 ;
7+
58/// NVIC register block.
69#[ derive( derive_mmio:: Mmio ) ]
710#[ repr( C ) ]
@@ -85,8 +88,9 @@ impl RegisterBlock {
8588 ///
8689 /// This potentially allows to create multiple instances of the NVIC register block, which
8790 /// might only be valid in certain multi-core environments.
88- pub const unsafe fn new ( ) -> MmioRegisterBlock < ' static > {
89- unsafe { RegisterBlock :: new_mmio_at ( 0xE000_E100 ) }
91+ #[ inline]
92+ pub const unsafe fn new_mmio_fixed ( ) -> MmioRegisterBlock < ' static > {
93+ unsafe { RegisterBlock :: new_mmio_at ( BASE_ADDRESS ) }
9094 }
9195}
9296
You can’t perform that action at this time.
0 commit comments