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

Use volatile read for ICSR register #315

Merged
merged 2 commits into from
Mar 2, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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(SCB_ICSR) as u8 as i16 - 16 };
let irqn = unsafe { (core::ptr::read_volatile(SCB_ICSR) & 0x1FF) as i16 - 16 };

#ident(irqn)
}
Expand Down