From 97079489ef8fbf1551ad651da6c55e325617cd5b Mon Sep 17 00:00:00 2001 From: contradict Date: Wed, 20 Oct 2021 12:38:30 -0700 Subject: [PATCH] Mark Timer as sync Since all accesses are read-only there is no synchronizing to be done. --- rp2040-hal/src/timer.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rp2040-hal/src/timer.rs b/rp2040-hal/src/timer.rs index 5728627..8f4808c 100644 --- a/rp2040-hal/src/timer.rs +++ b/rp2040-hal/src/timer.rs @@ -11,6 +11,9 @@ pub struct Timer { timer: TIMER, } +// Safety: All access is read-only. +unsafe impl Sync for Timer {} + impl Timer { /// Create a new [`Timer`] pub fn new(timer: TIMER, resets: &mut RESETS) -> Self {