Skip to content

Commit

Permalink
WIP: updates necessary because of rp2040-pac update
Browse files Browse the repository at this point in the history
  • Loading branch information
AkiyukiOkayasu committed Feb 14, 2024
1 parent e917138 commit 366d149
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion rp2040-hal/src/dma/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ trait ChannelRegs {

impl<CH: ChannelIndex> ChannelRegs for Channel<CH> {
unsafe fn ptr() -> *const pac::dma::CH {
&(*pac::DMA::ptr()).ch[CH::id() as usize] as *const _
(*pac::DMA::ptr()).ch(CH::id() as usize)
}

fn regs(&self) -> &pac::dma::CH {
Expand Down
8 changes: 4 additions & 4 deletions rp2040-hal/src/pio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,22 +39,22 @@ pub trait PIOExt: Deref<Target = RegisterBlock> + SubsystemReset + Sized + Send

let sm0 = UninitStateMachine {
block: self.deref(),
sm: &self.deref().sm(0),
sm: self.sm(0),
_phantom: core::marker::PhantomData,
};
let sm1 = UninitStateMachine {
block: self.deref(),
sm: &self.deref().sm(1),
sm: self.sm(1),
_phantom: core::marker::PhantomData,
};
let sm2 = UninitStateMachine {
block: self.deref(),
sm: &self.deref().sm(2),
sm: self.sm(2),
_phantom: core::marker::PhantomData,
};
let sm3 = UninitStateMachine {
block: self.deref(),
sm: &self.deref().sm(3),
sm: self.sm(3),
_phantom: core::marker::PhantomData,
};
(
Expand Down
2 changes: 1 addition & 1 deletion rp2040-hal/src/timer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ macro_rules! impl_alarm {

// This lock is for time-criticality
cortex_m::interrupt::free(|_| {
let alarm = &timer.$timer_alarm;
let alarm = &timer.$timer_alarm();

// safety: This is the only code in the codebase that accesses memory address $timer_alarm
alarm.write(|w| unsafe { w.bits(timestamp_low) });
Expand Down

0 comments on commit 366d149

Please sign in to comment.