diff --git a/services/xous-ticktimer/src/platform/cramium/implementation.rs b/services/xous-ticktimer/src/platform/cramium/implementation.rs index 8d4e45bfc..dfe101798 100644 --- a/services/xous-ticktimer/src/platform/cramium/implementation.rs +++ b/services/xous-ticktimer/src/platform/cramium/implementation.rs @@ -306,7 +306,7 @@ impl XousTickTimer { if let Some(current) = self.stop_interrupt() { #[cfg(feature = "debug-print")] log::info!("Existing request was {:?}", current); - sleep_heap.insert(current.msec, current); + assert!(sleep_heap.insert(current.msec, current).is_none(), "Existing sleep_heap entry would be overwritten"); } else { #[cfg(feature = "debug-print")] log::info!("There was no existing sleep() request"); @@ -363,7 +363,7 @@ impl XousTickTimer { #[cfg(feature = "debug-print")] log::info!("Modified, the request was: {:?}", request); - sleep_heap.insert(request.msec, request); + assert!(sleep_heap.insert(request.msec, request).is_none(), "Existing sleep_heap entry would be overwritten"); } else { #[cfg(feature = "debug-print")] log::info!("No new sleep request"); diff --git a/services/xous-ticktimer/src/platform/hosted/implementation.rs b/services/xous-ticktimer/src/platform/hosted/implementation.rs index 2e04702c9..9da84ec0e 100644 --- a/services/xous-ticktimer/src/platform/hosted/implementation.rs +++ b/services/xous-ticktimer/src/platform/hosted/implementation.rs @@ -174,7 +174,7 @@ impl XousTickTimer { if let Some(current) = self.stop_interrupt() { #[cfg(feature = "debug-print")] log::info!("Existing request was {:?}", current); - sleep_heap.insert(current.msec, current); + assert!(sleep_heap.insert(current.msec, current).is_none(), "Existing sleep_heap entry would be overwritten"); } else { #[cfg(feature = "debug-print")] log::info!("There was no existing sleep() request"); @@ -231,7 +231,7 @@ impl XousTickTimer { #[cfg(feature = "debug-print")] log::info!("Modified, the request was: {:?}", request); - sleep_heap.insert(request.msec, request); + assert!(sleep_heap.insert(request.msec, request).is_none(), "Existing sleep_heap entry would be overwritten"); } else { #[cfg(feature = "debug-print")] log::info!("No new sleep request"); diff --git a/services/xous-ticktimer/src/platform/precursor/implementation.rs b/services/xous-ticktimer/src/platform/precursor/implementation.rs index 380b8ffe7..3c259a6e5 100644 --- a/services/xous-ticktimer/src/platform/precursor/implementation.rs +++ b/services/xous-ticktimer/src/platform/precursor/implementation.rs @@ -287,7 +287,7 @@ impl XousTickTimer { if let Some(current) = self.stop_interrupt() { #[cfg(feature = "debug-print")] log::info!("Existing request was {:?}", current); - sleep_heap.insert(current.msec, current); + assert!(sleep_heap.insert(current.msec, current).is_none(), "Existing sleep_heap entry would be overwritten"); } else { #[cfg(feature = "debug-print")] log::info!("There was no existing sleep() request"); @@ -344,7 +344,7 @@ impl XousTickTimer { #[cfg(feature = "debug-print")] log::info!("Modified, the request was: {:?}", request); - sleep_heap.insert(request.msec, request); + assert!(sleep_heap.insert(request.msec, request).is_none(), "Existing sleep_heap entry would be overwritten"); } else { #[cfg(feature = "debug-print")] log::info!("No new sleep request");