aboutsummaryrefslogtreecommitdiff
path: root/src/peripheral/syst.rs
diff options
context:
space:
mode:
authorGravatar Tyler Holmes <tyler@holmesengineering.com> 2022-01-06 14:04:53 -0800
committerGravatar Tyler Holmes <tyler@holmesengineering.com> 2022-01-06 14:08:35 -0800
commit9e098a493ac80dbd4f15528a470250c77de16478 (patch)
tree1169f9bf87f04a8b5a910a02a1887881eb94526e /src/peripheral/syst.rs
parentef049c93808cf46e5151d2cc0b0ca0b00f90be10 (diff)
downloadcortex-m-9e098a493ac80dbd4f15528a470250c77de16478.tar.gz
cortex-m-9e098a493ac80dbd4f15528a470250c77de16478.tar.zst
cortex-m-9e098a493ac80dbd4f15528a470250c77de16478.zip
remove the ptr() function in favor of the PTR constant
Per #370/#235, the const fn ptr() was supposed to be deprecated and subsequently removed. This PR removes it for the master branch tracking the 0.8 release
Diffstat (limited to 'src/peripheral/syst.rs')
-rw-r--r--src/peripheral/syst.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/peripheral/syst.rs b/src/peripheral/syst.rs
index abcd00b..345acc2 100644
--- a/src/peripheral/syst.rs
+++ b/src/peripheral/syst.rs
@@ -98,14 +98,14 @@ impl SYST {
#[inline]
pub fn get_current() -> u32 {
// NOTE(unsafe) atomic read with no side effects
- unsafe { (*Self::ptr()).cvr.read() }
+ unsafe { (*Self::PTR).cvr.read() }
}
/// Gets reload value
#[inline]
pub fn get_reload() -> u32 {
// NOTE(unsafe) atomic read with no side effects
- unsafe { (*Self::ptr()).rvr.read() }
+ unsafe { (*Self::PTR).rvr.read() }
}
/// Returns the reload value with which the counter would wrap once per 10
@@ -116,14 +116,14 @@ impl SYST {
#[inline]
pub fn get_ticks_per_10ms() -> u32 {
// NOTE(unsafe) atomic read with no side effects
- unsafe { (*Self::ptr()).calib.read() & SYST_COUNTER_MASK }
+ unsafe { (*Self::PTR).calib.read() & SYST_COUNTER_MASK }
}
/// Checks if an external reference clock is available
#[inline]
pub fn has_reference_clock() -> bool {
// NOTE(unsafe) atomic read with no side effects
- unsafe { (*Self::ptr()).calib.read() & SYST_CALIB_NOREF == 0 }
+ unsafe { (*Self::PTR).calib.read() & SYST_CALIB_NOREF == 0 }
}
/// Checks if the counter wrapped (underflowed) since the last check
@@ -161,7 +161,7 @@ impl SYST {
#[inline]
pub fn is_precise() -> bool {
// NOTE(unsafe) atomic read with no side effects
- unsafe { (*Self::ptr()).calib.read() & SYST_CALIB_SKEW == 0 }
+ unsafe { (*Self::PTR).calib.read() & SYST_CALIB_SKEW == 0 }
}
/// Sets clock source