We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a70f622 commit f476433Copy full SHA for f476433
src/peripheral/scb.rs
@@ -745,7 +745,7 @@ impl SCB {
745
{
746
// NOTE(unsafe) atomic read with no side effects
747
let shpr = unsafe { (*Self::ptr()).shpr[usize::from((index - 8) / 4)].read() };
748
- let prio = (shpr >> (index % 4)) & 0x000000ff;
+ let prio = (shpr >> (8 * (index % 4))) & 0x000000ff;
749
prio as u8
750
}
751
@@ -773,7 +773,7 @@ impl SCB {
773
#[cfg(armv6m)]
774
775
self.shpr[usize::from((index - 8) / 4)].modify(|value| {
776
- let shift = index % 4;
+ let shift = 8 * (index % 4);
777
let mask = 0x000000ff << shift;
778
let prio = u32::from(prio) << shift;
779
0 commit comments