-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SCB.ICSR.VECTACTIVE
is 9 bits, not 8
#373
Conversation
r? @therealprof (rust-highfive has picked a reviewer for you, use r? to override) |
src/peripheral/scb.rs
Outdated
@@ -300,7 +301,7 @@ impl VectActive { | |||
12 => VectActive::Exception(Exception::DebugMonitor), | |||
14 => VectActive::Exception(Exception::PendSV), | |||
15 => VectActive::Exception(Exception::SysTick), | |||
irqn if irqn >= 16 => VectActive::Interrupt { irqn }, | |||
irqn if irqn >= 16 && irqn < 512 => VectActive::Interrupt { irqn: irqn - 16 }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the - 16
was added to be consistent with how vect_active
does it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that a breaking change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but I think the rest of this PR is too
@@ -170,9 +170,10 @@ impl SCB { | |||
/// Returns the active exception number | |||
#[inline] | |||
pub fn vect_active() -> VectActive { | |||
let icsr = unsafe { ptr::read(&(*SCB::ptr()).icsr as *const _ as *const u32) }; | |||
let icsr = | |||
unsafe { ptr::read_volatile(&(*SCB::ptr()).icsr as *const _ as *const u32) } & 0x1FF; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed to read_volatile
like cortex-m-rt
did to prevent optimizations here
rebased on top of the asm PR to fix CI |
Thanks! I think we can merge this now that master is explicitly for 0.8 development, but could you add a changelog entry, especially highlighting the |
whoops, sure! I also added an entry for my change in #367 since I forgot that too. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
bors merge
Build succeeded! And happy new year! 🎉 |
Closes #332