aboutsummaryrefslogtreecommitdiff
path: root/rtic-time/src/half_period_counter.rs
diff options
context:
space:
mode:
Diffstat (limited to 'rtic-time/src/half_period_counter.rs')
-rw-r--r--rtic-time/src/half_period_counter.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/rtic-time/src/half_period_counter.rs b/rtic-time/src/half_period_counter.rs
index 5d3bf752..0aaec5e2 100644
--- a/rtic-time/src/half_period_counter.rs
+++ b/rtic-time/src/half_period_counter.rs
@@ -96,11 +96,13 @@
//! fn on_interrupt() {
//! if overflow_interrupt_happened() {
//! clear_overflow_interrupt();
-//! HALF_PERIOD_COUNTER.fetch_add(1, Ordering::Relaxed);
+//! let prev = HALF_PERIOD_COUNTER.fetch_add(1, Ordering::Relaxed);
+//! assert!(prev % 2 == 1, "Monotonic must have skipped an interrupt!");
//! }
//! if compare_interrupt_happened() {
//! clear_compare_interrupt();
-//! HALF_PERIOD_COUNTER.fetch_add(1, Ordering::Relaxed);
+//! let prev = HALF_PERIOD_COUNTER.fetch_add(1, Ordering::Relaxed);
+//! assert!(prev % 2 == 0, "Monotonic must have skipped an interrupt!");
//! }
//! }
//!