From 5b2d72244681effaa0c67d611d6376a6e95987ba Mon Sep 17 00:00:00 2001 From: Emil Fresk Date: Tue, 8 Aug 2023 10:45:19 +0200 Subject: [PATCH] Support RP2040 PAC v0.5 in `rtic-monotonics` --- rtic-monotonics/CHANGELOG.md | 3 ++- rtic-monotonics/Cargo.toml | 2 +- rtic-monotonics/src/rp2040.rs | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/rtic-monotonics/CHANGELOG.md b/rtic-monotonics/CHANGELOG.md index 46aeb7ea38..33fd2e906b 100644 --- a/rtic-monotonics/CHANGELOG.md +++ b/rtic-monotonics/CHANGELOG.md @@ -9,6 +9,7 @@ For each category, *Added*, *Changed*, *Fixed* add new entries at the top! ### Added +- RP2040 PAC 0.5 support - nRF52xxx, nRF9160, nRF5340 Timer and RTC monotonics - Interrupt tokens for `Systick` and `rp2040` to make sure an interrupt handler exists @@ -17,6 +18,6 @@ For each category, *Added*, *Changed*, *Fixed* add new entries at the top! ### Fixed - Unmask the `rp2040` interrupt -- Use `$crate` and fully qualified paths in macros +- Use `$crate` and fully qualified paths in macros ## [v1.0.0] - 2023-05-31 diff --git a/rtic-monotonics/Cargo.toml b/rtic-monotonics/Cargo.toml index 88fd208cf0..6af6df0ec3 100644 --- a/rtic-monotonics/Cargo.toml +++ b/rtic-monotonics/Cargo.toml @@ -28,7 +28,7 @@ cortex-m = { version = "0.7.6", optional = true } critical-section = { version = "1", optional = true } # RP2040 -rp2040-pac = { version = ">=0.2.0,<0.5", optional = true } +rp2040-pac = { version = ">=0.2.0,<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 a6e0af6b2c..61bd1ff76f 100644 --- a/rtic-monotonics/src/rp2040.rs +++ b/rtic-monotonics/src/rp2040.rs @@ -43,7 +43,7 @@ impl Timer { ) { resets.reset.modify(|_, w| w.timer().clear_bit()); while resets.reset_done.read().timer().bit_is_clear() {} - timer.inte.modify(|_, w| w.alarm_0().set_bit()); + timer.inte.modify(|_, w| w.alarm_0().bit(true)); TIMER_QUEUE.initialize(Self {}); @@ -137,7 +137,7 @@ impl Monotonic for Timer { } fn clear_compare_flag() { - Self::timer().intr.modify(|_, w| w.alarm_0().set_bit()); + Self::timer().intr.modify(|_, w| w.alarm_0().bit(true)); } fn pend_interrupt() {