aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJorge Aparicio <jorge@japaric.io>2020-01-21 22:23:20 +0100
committerJorge Aparicio <jorge@japaric.io>2020-01-21 22:23:20 +0100
commitb04103f6df712233b7659f2a845461f4db682e32 (patch)
tree9e190b25b18e2897bffa5bc39d577b1f19493c75 /src
parent6b0a2df41c024fa8e7da07f3b42a80f19840432e (diff)
docs: do not use Instant::now in #[init]
Diffstat (limited to 'src')
-rw-r--r--src/cyccnt.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/cyccnt.rs b/src/cyccnt.rs
index 86969cb..4b12408 100644
--- a/src/cyccnt.rs
+++ b/src/cyccnt.rs
@@ -30,6 +30,10 @@ pub struct Instant {
impl Instant {
/// Returns an instant corresponding to "now"
+ ///
+ /// *HEADS UP* this function can, and will, return nonsensical values if called within `init`.
+ /// Only use it in `idle` and tasks. In `init`, use the `init::Context.start` field, or the
+ /// `CYCCNT::zero` function, instead of this function
pub fn now() -> Self {
Instant {
inner: DWT::get_cycle_count() as i32,