aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-01-24 15:14:58 +0000
committerGitHub <noreply@github.com>2020-01-24 15:14:58 +0000
commit03ac76a0a209f4af2baaf4bb56057b96a672e391 (patch)
treef0980487592af1fdbb20c171409adaeab82e5f66 /src
parent1e827e24d024e910b44f6cc6db278e4c66a77683 (diff)
parentb04103f6df712233b7659f2a845461f4db682e32 (diff)
Merge #295
295: docs: do not use Instant::now in #[init] r=korken89 a=japaric Co-authored-by: Jorge Aparicio <jorge@japaric.io>
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 338bbbe..6bc2ef0 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,