diff options
| author | Martins Polakovs <mp@foo.lv> | 2024-04-21 13:46:29 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-21 10:46:29 +0000 |
| commit | 5d05d607eefde4a659150f8180457b0eed37bc8c (patch) | |
| tree | 17dae6b9f1cb264ee958f0a5716ccbe67cef308f /rtic-monotonics | |
| parent | acb9f446425a3bf6b00e542770bdbfd3c0bfe53e (diff) | |
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
Diffstat (limited to 'rtic-monotonics')
| -rw-r--r-- | rtic-monotonics/CHANGELOG.md | 1 | ||||
| -rw-r--r-- | rtic-monotonics/Cargo.toml | 2 | ||||
| -rw-r--r-- | rtic-monotonics/src/rp2040.rs | 16 |
3 files changed, 10 insertions, 9 deletions
diff --git a/rtic-monotonics/CHANGELOG.md b/rtic-monotonics/CHANGELOG.md index f114a18..14d239d 100644 --- a/rtic-monotonics/CHANGELOG.md +++ b/rtic-monotonics/CHANGELOG.md @@ -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 diff --git a/rtic-monotonics/Cargo.toml b/rtic-monotonics/Cargo.toml index 81df240..c9756dc 100644 --- a/rtic-monotonics/Cargo.toml +++ b/rtic-monotonics/Cargo.toml @@ -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 } diff --git a/rtic-monotonics/src/rp2040.rs b/rtic-monotonics/src/rp2040.rs index d4f590f..9c5a1dd 100644 --- a/rtic-monotonics/src/rp2040.rs +++ b/rtic-monotonics/src/rp2040.rs @@ -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() { |
