Bump rp2040-pac to 0.6 in rtic-monotonics (#905)

* Support rp2040-pac v0.6 in rtic-monotonics

* Add changelog entry

* Fix rp2040_local_i2c_init example
This commit is contained in:
Martins Polakovs 2024-04-21 13:46:29 +03:00 committed by GitHub
parent acb9f44642
commit 5d05d607ee
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 121 additions and 65 deletions

View file

@ -51,9 +51,9 @@ impl TimerBackend {
///
/// Use the prelude macros instead.
pub fn _start(timer: TIMER, resets: &RESETS) {
resets.reset.modify(|_, w| w.timer().clear_bit());
while resets.reset_done.read().timer().bit_is_clear() {}
timer.inte.modify(|_, w| w.alarm_0().bit(true));
resets.reset().modify(|_, w| w.timer().clear_bit());
while resets.reset_done().read().timer().bit_is_clear() {}
timer.inte().modify(|_, w| w.alarm_0().bit(true));
TIMER_QUEUE.initialize(Self {});
@ -76,10 +76,10 @@ impl TimerQueueBackend for TimerBackend {
fn now() -> Self::Ticks {
let timer = Self::timer();
let mut hi0 = timer.timerawh.read().bits();
let mut hi0 = timer.timerawh().read().bits();
loop {
let low = timer.timerawl.read().bits();
let hi1 = timer.timerawh.read().bits();
let low = timer.timerawl().read().bits();
let hi1 = timer.timerawh().read().bits();
if hi0 == hi1 {
break ((u64::from(hi0) << 32) | u64::from(low));
}
@ -102,12 +102,12 @@ impl TimerQueueBackend for TimerBackend {
};
Self::timer()
.alarm0
.alarm0()
.write(|w| unsafe { w.bits(val as u32) });
}
fn clear_compare_flag() {
Self::timer().intr.modify(|_, w| w.alarm_0().bit(true));
Self::timer().intr().modify(|_, w| w.alarm_0().bit(true));
}
fn pend_interrupt() {