aboutsummaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
authorGravatar Jorge Aparicio <jorge@japaric.io> 2019-06-24 14:09:12 +0200
committerGravatar Jorge Aparicio <jorge@japaric.io> 2019-06-24 14:09:12 +0200
commit596cf585ea8dc278d88e0652dffbacbc75de04c6 (patch)
tree147bad178f15a7e7a91d847f39d501ecc1051821 /src/lib.rs
parent4e51bb68b976c6bb6a9a989dc560d2a8123a84ca (diff)
downloadrtic-596cf585ea8dc278d88e0652dffbacbc75de04c6.tar.gz
rtic-596cf585ea8dc278d88e0652dffbacbc75de04c6.tar.zst
rtic-596cf585ea8dc278d88e0652dffbacbc75de04c6.zip
Monotonic trait is safe; add MultiCore trait
Diffstat (limited to '')
-rw-r--r--src/lib.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lib.rs b/src/lib.rs
index acb3a63d..decd2da1 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -117,7 +117,7 @@ impl From<cortex_m::Peripherals> for Peripherals {
}
/// A monotonic clock / counter
-pub unsafe trait Monotonic {
+pub trait Monotonic {
/// A measurement of this clock
type Instant: Copy + Ord + Sub;
@@ -134,6 +134,9 @@ pub unsafe trait Monotonic {
fn zero() -> Self::Instant;
}
+/// A marker trait that indicates that it is correct to use this type in multi-core context
+pub trait MultiCore {}
+
/// Sets the given `interrupt` as pending
///
/// This is a convenience function around