diff options
| author | Matteo Meluzzi <[email protected]> | 2025-10-24 15:48:34 +0200 |
|---|---|---|
| committer | Matteo Meluzzi <[email protected]> | 2025-10-24 15:48:34 +0200 |
| commit | 7976f950b0de72c521f92efa350c67ccd197fab9 (patch) | |
| tree | 8759312eb000de09b92a4921f476d5c16b7e7342 /examples/boot/bootloader/nrf/src/main.rs | |
| parent | 828a8df18d04877df1f55f04354980b28ff2f2f8 (diff) | |
Merge branch 'main' into 17-add-support-for-boot-protocol
Diffstat (limited to 'examples/boot/bootloader/nrf/src/main.rs')
| -rw-r--r-- | examples/boot/bootloader/nrf/src/main.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/boot/bootloader/nrf/src/main.rs b/examples/boot/bootloader/nrf/src/main.rs index b849a0df3..76c4c1048 100644 --- a/examples/boot/bootloader/nrf/src/main.rs +++ b/examples/boot/bootloader/nrf/src/main.rs | |||
| @@ -38,8 +38,8 @@ fn main() -> ! { | |||
| 38 | unsafe { bl.load(active_offset) } | 38 | unsafe { bl.load(active_offset) } |
| 39 | } | 39 | } |
| 40 | 40 | ||
| 41 | #[no_mangle] | 41 | #[unsafe(no_mangle)] |
| 42 | #[cfg_attr(target_os = "none", link_section = ".HardFault.user")] | 42 | #[cfg_attr(target_os = "none", unsafe(link_section = ".HardFault.user"))] |
| 43 | unsafe extern "C" fn HardFault() { | 43 | unsafe extern "C" fn HardFault() { |
| 44 | cortex_m::peripheral::SCB::sys_reset(); | 44 | cortex_m::peripheral::SCB::sys_reset(); |
| 45 | } | 45 | } |
| @@ -47,7 +47,7 @@ unsafe extern "C" fn HardFault() { | |||
| 47 | #[exception] | 47 | #[exception] |
| 48 | unsafe fn DefaultHandler(_: i16) -> ! { | 48 | unsafe fn DefaultHandler(_: i16) -> ! { |
| 49 | const SCB_ICSR: *const u32 = 0xE000_ED04 as *const u32; | 49 | const SCB_ICSR: *const u32 = 0xE000_ED04 as *const u32; |
| 50 | let irqn = core::ptr::read_volatile(SCB_ICSR) as u8 as i16 - 16; | 50 | let irqn = unsafe { core::ptr::read_volatile(SCB_ICSR) } as u8 as i16 - 16; |
| 51 | 51 | ||
| 52 | panic!("DefaultHandler #{:?}", irqn); | 52 | panic!("DefaultHandler #{:?}", irqn); |
| 53 | } | 53 | } |
