diff --git a/esp-hal/CHANGELOG.md b/esp-hal/CHANGELOG.md index 2316afaecd..2aedb942b6 100644 --- a/esp-hal/CHANGELOG.md +++ b/esp-hal/CHANGELOG.md @@ -12,11 +12,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - ESP32-S3: Added SDMMC signals (#2556) - `dma::{Channel, ChannelRx, ChannelTx}::set_priority` for GDMA devices (#2403) - `SystemTimer::set_unit_count` & `SystemTimer::configure_unit` (#2576) +- `SystemTimer::set_unit_value` & `SystemTimer::configure_unit` (#2576) ### Changed - `SystemTimer` no longer uses peripheral ref (#2576) -- `SystemTimer::now` has been renamed `SystemTimer::unit_count(Unit)` (#2576) +- `SystemTimer::now` has been renamed `SystemTimer::unit_value(Unit)` (#2576) ### Fixed diff --git a/esp-hal/src/time.rs b/esp-hal/src/time.rs index e103374e5a..38a29de659 100644 --- a/esp-hal/src/time.rs +++ b/esp-hal/src/time.rs @@ -49,7 +49,7 @@ pub fn now() -> Instant { let (ticks, div) = { use crate::timer::systimer::{SystemTimer, Unit}; // otherwise use SYSTIMER - let ticks = SystemTimer::unit_count(Unit::Unit0); + let ticks = SystemTimer::unit_value(Unit::Unit0); (ticks, (SystemTimer::ticks_per_second() / 1_000_000)) }; diff --git a/esp-hal/src/timer/systimer.rs b/esp-hal/src/timer/systimer.rs index e9f6c63272..383b417887 100644 --- a/esp-hal/src/timer/systimer.rs +++ b/esp-hal/src/timer/systimer.rs @@ -108,7 +108,7 @@ impl SystemTimer { } /// Get the current count of the given unit in the System Timer. - pub fn unit_count(unit: Unit) -> u64 { + pub fn unit_value(unit: Unit) -> u64 { // This should be safe to access from multiple contexts // worst case scenario the second accessor ends up reading // an older time stamp @@ -142,7 +142,7 @@ impl SystemTimer { /// unexpected behaviour /// - Any modification of the unit0 count will affect /// [`now`](crate::time::now). - pub unsafe fn set_unit_count(unit: Unit, value: u64) { + pub unsafe fn set_unit_value(unit: Unit, value: u64) { unit.set_count(value) } }