aboutsummaryrefslogtreecommitdiff
path: root/rtic-monotonics/src/lib.rs
diff options
context:
space:
mode:
authorGravatar Emil Fresk <emil.fresk@gmail.com> 2023-03-11 20:47:39 +0100
committerGravatar Emil Fresk <emil.fresk@gmail.com> 2023-03-11 20:59:26 +0100
commite4d9284e258a34b10cac2eff47ca2ccb470b460c (patch)
treeea1895b33480484bbc44771efdff33c7e5b6dd25 /rtic-monotonics/src/lib.rs
parent7c7d6558f6d9c50fbb4d2487c98c9a5be15f2f7b (diff)
downloadrtic-e4d9284e258a34b10cac2eff47ca2ccb470b460c.tar.gz
rtic-e4d9284e258a34b10cac2eff47ca2ccb470b460c.tar.zst
rtic-e4d9284e258a34b10cac2eff47ca2ccb470b460c.zip
rtic-monotonics: Add interrupt tokens to make sure users bind interrupts
Diffstat (limited to 'rtic-monotonics/src/lib.rs')
-rw-r--r--rtic-monotonics/src/lib.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/rtic-monotonics/src/lib.rs b/rtic-monotonics/src/lib.rs
index a4a1f428..6143fd0e 100644
--- a/rtic-monotonics/src/lib.rs
+++ b/rtic-monotonics/src/lib.rs
@@ -13,3 +13,13 @@ pub mod systick;
#[cfg(feature = "rp2040")]
pub mod rp2040;
+
+/// This marker is implemented on an interrupt token to enforce that the right tokens
+/// are given to the correct monotonic implementation.
+///
+/// This trait is implemented by this crate and not intended for user implementation.
+///
+/// # Safety
+///
+/// This is only safely implemented by this crate.
+pub unsafe trait InterruptToken<Periperhal> {}