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

@ -13,6 +13,7 @@ For each category, *Added*, *Changed*, *Fixed* add new entries at the top!
- Most timer tick rates are now configurable
- Tweak `build.rs` to avoid warnings in Nightly 1.78+
- Removed unused `rust-toolchain.toml`
- RP2040 PAC 0.6 support
## v1.5.0 - 2024-01-10

View file

@ -42,7 +42,7 @@ cortex-m = { version = "0.7.6", optional = true }
critical-section = { version = "1", optional = true }
# RP2040
rp2040-pac = { version = ">=0.2.0,<0.6", optional = true }
rp2040-pac = { version = "0.6", optional = true }
# nRF52
nrf52810-pac = { version = "0.12.2", optional = true }

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() {