diff options
| author | Rasmus Melchior Jacobsen <[email protected]> | 2023-05-30 14:03:31 +0200 |
|---|---|---|
| committer | Rasmus Melchior Jacobsen <[email protected]> | 2023-05-30 14:03:31 +0200 |
| commit | 36e00caf4dc70905b735531c0d5634addd026954 (patch) | |
| tree | 01d3bbb3b7f1ab522f9a1fc651f48197ce355927 /embassy-boot | |
| parent | c2aca45b8d3785007da20ce007d6a6e352fac1a0 (diff) | |
Align examples
Diffstat (limited to 'embassy-boot')
| -rw-r--r-- | embassy-boot/nrf/src/lib.rs | 4 | ||||
| -rw-r--r-- | embassy-boot/rp/src/lib.rs | 4 | ||||
| -rw-r--r-- | embassy-boot/stm32/src/lib.rs | 4 |
3 files changed, 9 insertions, 3 deletions
diff --git a/embassy-boot/nrf/src/lib.rs b/embassy-boot/nrf/src/lib.rs index e26b07c9f..bb702073c 100644 --- a/embassy-boot/nrf/src/lib.rs +++ b/embassy-boot/nrf/src/lib.rs | |||
| @@ -42,7 +42,9 @@ impl<ACTIVE: NorFlash, DFU: NorFlash, STATE: NorFlash, const BUFFER_SIZE: usize> | |||
| 42 | /// | 42 | /// |
| 43 | /// This modifies the stack pointer and reset vector and will run code placed in the active partition. | 43 | /// This modifies the stack pointer and reset vector and will run code placed in the active partition. |
| 44 | #[cfg(not(feature = "softdevice"))] | 44 | #[cfg(not(feature = "softdevice"))] |
| 45 | pub unsafe fn load(&mut self, start: u32) -> ! { | 45 | pub unsafe fn load(self, start: u32) -> ! { |
| 46 | core::mem::drop(self.boot); | ||
| 47 | |||
| 46 | let mut p = cortex_m::Peripherals::steal(); | 48 | let mut p = cortex_m::Peripherals::steal(); |
| 47 | p.SCB.invalidate_icache(); | 49 | p.SCB.invalidate_icache(); |
| 48 | p.SCB.vtor.write(start); | 50 | p.SCB.vtor.write(start); |
diff --git a/embassy-boot/rp/src/lib.rs b/embassy-boot/rp/src/lib.rs index e825a7d13..25329f9e9 100644 --- a/embassy-boot/rp/src/lib.rs +++ b/embassy-boot/rp/src/lib.rs | |||
| @@ -42,7 +42,9 @@ impl<ACTIVE: NorFlash, DFU: NorFlash, STATE: NorFlash, const BUFFER_SIZE: usize> | |||
| 42 | /// # Safety | 42 | /// # Safety |
| 43 | /// | 43 | /// |
| 44 | /// This modifies the stack pointer and reset vector and will run code placed in the active partition. | 44 | /// This modifies the stack pointer and reset vector and will run code placed in the active partition. |
| 45 | pub unsafe fn load(&mut self, start: u32) -> ! { | 45 | pub unsafe fn load(self, start: u32) -> ! { |
| 46 | core::mem::drop(self.boot); | ||
| 47 | |||
| 46 | trace!("Loading app at 0x{:x}", start); | 48 | trace!("Loading app at 0x{:x}", start); |
| 47 | #[allow(unused_mut)] | 49 | #[allow(unused_mut)] |
| 48 | let mut p = cortex_m::Peripherals::steal(); | 50 | let mut p = cortex_m::Peripherals::steal(); |
diff --git a/embassy-boot/stm32/src/lib.rs b/embassy-boot/stm32/src/lib.rs index b47b2db43..069de0d1a 100644 --- a/embassy-boot/stm32/src/lib.rs +++ b/embassy-boot/stm32/src/lib.rs | |||
| @@ -38,7 +38,9 @@ impl<ACTIVE: NorFlash, DFU: NorFlash, STATE: NorFlash, const BUFFER_SIZE: usize> | |||
| 38 | /// # Safety | 38 | /// # Safety |
| 39 | /// | 39 | /// |
| 40 | /// This modifies the stack pointer and reset vector and will run code placed in the active partition. | 40 | /// This modifies the stack pointer and reset vector and will run code placed in the active partition. |
| 41 | pub unsafe fn load(&mut self, start: u32) -> ! { | 41 | pub unsafe fn load(self, start: u32) -> ! { |
| 42 | core::mem::drop(self.boot); | ||
| 43 | |||
| 42 | trace!("Loading app at 0x{:x}", start); | 44 | trace!("Loading app at 0x{:x}", start); |
| 43 | #[allow(unused_mut)] | 45 | #[allow(unused_mut)] |
| 44 | let mut p = cortex_m::Peripherals::steal(); | 46 | let mut p = cortex_m::Peripherals::steal(); |
