Skip to content
This repository has been archived by the owner on Jan 24, 2022. It is now read-only.

Commit

Permalink
Read all bits for the ICSR
Browse files Browse the repository at this point in the history
The 9th bit is needed to all 480 interrupts on Cortex-M33
  • Loading branch information
lulf committed Feb 25, 2021
1 parent fa65b66 commit 58e391c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ pub fn exception(args: TokenStream, input: TokenStream) -> TokenStream {

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

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

#ident(irqn)
}
Expand Down

0 comments on commit 58e391c

Please sign in to comment.