Skip to content

Commit

Permalink
Fix WB post prev updates
Browse files Browse the repository at this point in the history
  • Loading branch information
David-OConnor committed Jan 11, 2024
1 parent a4afc10 commit e34b582
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions src/hsem.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//! Hardware semaphore (HSEM)
//! Used on STM32WB to synchronize processes running on different cores.
use critical_section::with;
use paste::paste;

use crate::pac::{self, HSEM, RCC};
Expand Down Expand Up @@ -34,18 +33,16 @@ macro_rules! set_register_sem {
/// Represents an Hardware Semiphore (HSEM) peripheral.
impl Hsem {
pub fn new(regs: HSEM) -> Self {
with(|cs| {
let mut rcc = unsafe { &(*RCC::ptr()) };

rcc.ahb3enr.modify(|_, w| w.hsemen().set_bit());
rcc.ahb3rstr.modify(|_, w| w.hsemrst().set_bit());
rcc.ahb3rstr.modify(|_, w| w.hsemrst().clear_bit());

// todo: Why are these missing here and on IPCC `new`?
// rcc.ahb4enr.modify(|_, w| w.hsemen().set_bit());
// rcc.ahb4rstr.modify(|_, w| w.hsemrst().set_bit());
// rcc.ahb4rstr.modify(|_, w| w.hsemrst().clear_bit());
});
let mut rcc = unsafe { &(*RCC::ptr()) };

rcc.ahb3enr.modify(|_, w| w.hsemen().set_bit());
rcc.ahb3rstr.modify(|_, w| w.hsemrst().set_bit());
rcc.ahb3rstr.modify(|_, w| w.hsemrst().clear_bit());

// todo: Why are these missing here and on IPCC `new`?
// rcc.ahb4enr.modify(|_, w| w.hsemen().set_bit());
// rcc.ahb4rstr.modify(|_, w| w.hsemrst().set_bit());
// rcc.ahb4rstr.modify(|_, w| w.hsemrst().clear_bit());

Self { regs }
}
Expand Down

0 comments on commit e34b582

Please sign in to comment.