Skip to content

Commit

Permalink
Pick up a depreciation warning from cortex-m v0.7.4
Browse files Browse the repository at this point in the history
  • Loading branch information
richardeoin committed Jan 3, 2022
1 parent be64eb7 commit 2cf6553
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions examples/mdma_bursts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,15 @@ 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(|_| {});

// Wait for transfer to complete
while !transfer.get_transfer_complete_flag() {}

DWT::get_cycle_count() - start
DWT::cycle_count() - start
};
}

Expand Down
4 changes: 2 additions & 2 deletions examples/sdmmc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

0 comments on commit 2cf6553

Please sign in to comment.