From 19bab47bba8f8a4f5dd3255bb7ad37bf1597b02d Mon Sep 17 00:00:00 2001 From: Emil Fresk Date: Sat, 11 Mar 2023 20:25:35 +0100 Subject: [PATCH] rtic-monotonics: Unmask the RP2040 timer --- rtic-monotonics/CHANGELOG.md | 2 ++ rtic-monotonics/src/rp2040.rs | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/rtic-monotonics/CHANGELOG.md b/rtic-monotonics/CHANGELOG.md index d3a9d846ee..1ccf28a5d0 100644 --- a/rtic-monotonics/CHANGELOG.md +++ b/rtic-monotonics/CHANGELOG.md @@ -13,4 +13,6 @@ For each category, *Added*, *Changed*, *Fixed* add new entries at the top! ### Fixed +- Unmask the `rp2040` interrupt + ## [v1.0.0] - 2023-xx-xx diff --git a/rtic-monotonics/src/rp2040.rs b/rtic-monotonics/src/rp2040.rs index e42c148e4c..6599dc6a7e 100644 --- a/rtic-monotonics/src/rp2040.rs +++ b/rtic-monotonics/src/rp2040.rs @@ -4,7 +4,7 @@ use super::Monotonic; pub use super::{TimeoutError, TimerQueue}; use core::future::Future; pub use fugit::ExtU64; -use rp2040_pac::{timer, Interrupt, RESETS, TIMER}; +use rp2040_pac::{timer, Interrupt, NVIC, RESETS, TIMER}; /// Timer implementing `rtic_monotonic::Monotonic` which runs at 1 MHz. pub struct Timer; @@ -17,6 +17,8 @@ impl Timer { timer.inte.modify(|_, w| w.alarm_0().set_bit()); TIMER_QUEUE.initialize(Self {}); + + unsafe { NVIC::unmask(Interrupt::TIMER_IRQ_0) }; } fn timer() -> &'static timer::RegisterBlock {