Skip to content

Commit

Permalink
clippy: fix new lint errors with 1.80
Browse files Browse the repository at this point in the history
  • Loading branch information
astapleton committed Jul 31, 2024
1 parent e9be823 commit 8a23b98
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@ stm32h562 = ["stm32h5/stm32h562", "device-selected", "rm0481"]
stm32h563 = ["stm32h5/stm32h563", "device-selected", "rm0481"]
stm32h573 = ["stm32h5/stm32h573", "device-selected", "rm0481"]
# Flags for examples
log-itm = ["dep:log"]
log-rtt = ["dep:log"]
log-semihost = ["dep:log"]
log = ["dep:log"]
log-itm = ["log"]
log-rtt = ["log"]
log-semihost = ["log"]

[dependencies]
cortex-m = { version = "^0.7.7", features = ["critical-section-single-core"] }
Expand Down
4 changes: 4 additions & 0 deletions src/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ pub struct Instant {
}

impl Instant {
pub fn new(now: u32) -> Self {
Self { now }
}

/// Ticks elapsed since the `Instant` was created
pub fn elapsed(&self) -> u32 {
DWT::cycle_count().wrapping_sub(self.now)
Expand Down

0 comments on commit 8a23b98

Please sign in to comment.