From 2cf6553ef2a7821001c1e7cf34efbda53c63e1da Mon Sep 17 00:00:00 2001 From: Richard Meadows <962920+richardeoin@users.noreply.github.com> Date: Mon, 3 Jan 2022 21:24:29 +0100 Subject: [PATCH] Pick up a depreciation warning from cortex-m v0.7.4 --- examples/mdma_bursts.rs | 4 ++-- examples/sdmmc.rs | 4 ++-- src/time.rs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/mdma_bursts.rs b/examples/mdma_bursts.rs index ccd7776d..0fb4e14f 100644 --- a/examples/mdma_bursts.rs +++ b/examples/mdma_bursts.rs @@ -112,7 +112,7 @@ fn main() -> ! { let mut cycles = 0; for _ in 0..10 { cycles += { - let start = DWT::get_cycle_count(); + let start = DWT::cycle_count(); // Start block transfer.start(|_| {}); @@ -120,7 +120,7 @@ fn main() -> ! { // Wait for transfer to complete while !transfer.get_transfer_complete_flag() {} - DWT::get_cycle_count() - start + DWT::cycle_count() - start }; } diff --git a/examples/sdmmc.rs b/examples/sdmmc.rs index 5751e43a..613fb64d 100644 --- a/examples/sdmmc.rs +++ b/examples/sdmmc.rs @@ -141,14 +141,14 @@ fn main() -> ! { let mut buffer = [0u8; 5120]; cp.DWT.enable_cycle_counter(); - let start = pac::DWT::get_cycle_count(); + let start = pac::DWT::cycle_count(); for i in 0..10 { // Read 10 blocks sdmmc.read_blocks(10 * i, &mut buffer).unwrap(); } - let end = pac::DWT::get_cycle_count(); + let end = pac::DWT::cycle_count(); let duration = (end - start) as f32 / ccdr.clocks.c_ck().0 as f32; info!("Read 100 blocks at {} bytes/s", 5120. / duration); diff --git a/src/time.rs b/src/time.rs index 6ce9c5ac..741f0947 100644 --- a/src/time.rs +++ b/src/time.rs @@ -273,6 +273,6 @@ pub struct Instant { impl Instant { /// Ticks elapsed since the `Instant` was created pub fn elapsed(&self) -> u32 { - DWT::get_cycle_count().wrapping_sub(self.now) + DWT::cycle_count().wrapping_sub(self.now) } }