Skip to content

Commit 59d30a4

Browse files
committed
Read all bits from ICSR register
The 9th bit is needed to all 480 interrupts on Cortex-M33
1 parent d802c58 commit 59d30a4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cortex-m-rt/macros/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ pub fn exception(args: TokenStream, input: TokenStream) -> TokenStream {
227227

228228
const SCB_ICSR: *const u32 = 0xE000_ED04 as *const u32;
229229

230-
let irqn = unsafe { core::ptr::read_volatile(SCB_ICSR) as u8 as i16 - 16 };
230+
let irqn = unsafe { (core::ptr::read_volatile(SCB_ICSR) & 0x1FF) as i16 - 16 };
231231

232232
#ident(irqn)
233233
}

0 commit comments

Comments
 (0)