diff options
author | 2022-01-06 14:04:53 -0800 | |
---|---|---|
committer | 2022-01-06 14:08:35 -0800 | |
commit | 9e098a493ac80dbd4f15528a470250c77de16478 (patch) | |
tree | 1169f9bf87f04a8b5a910a02a1887881eb94526e /src/peripheral/dwt.rs | |
parent | ef049c93808cf46e5151d2cc0b0ca0b00f90be10 (diff) | |
download | cortex-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/dwt.rs')
-rw-r--r-- | src/peripheral/dwt.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/peripheral/dwt.rs b/src/peripheral/dwt.rs index db0398d..c5f7bc9 100644 --- a/src/peripheral/dwt.rs +++ b/src/peripheral/dwt.rs @@ -214,7 +214,7 @@ impl DWT { #[inline] pub fn cycle_count() -> u32 { // NOTE(unsafe) atomic read with no side effects - unsafe { (*Self::ptr()).cyccnt.read() } + unsafe { (*Self::PTR).cyccnt.read() } } /// Set the cycle count @@ -231,7 +231,7 @@ impl DWT { #[inline] pub fn unlock() { // NOTE(unsafe) atomic write to a stateless, write-only register - unsafe { (*Self::ptr()).lar.write(0xC5AC_CE55) } + unsafe { (*Self::PTR).lar.write(0xC5AC_CE55) } } /// Get the CPI count @@ -245,7 +245,7 @@ impl DWT { #[inline] pub fn cpi_count() -> u8 { // NOTE(unsafe) atomic read with no side effects - unsafe { (*Self::ptr()).cpicnt.read() as u8 } + unsafe { (*Self::PTR).cpicnt.read() as u8 } } /// Set the CPI count @@ -260,7 +260,7 @@ impl DWT { #[inline] pub fn exception_count() -> u8 { // NOTE(unsafe) atomic read with no side effects - unsafe { (*Self::ptr()).exccnt.read() as u8 } + unsafe { (*Self::PTR).exccnt.read() as u8 } } /// Set the exception count @@ -281,7 +281,7 @@ impl DWT { #[inline] pub fn sleep_count() -> u8 { // NOTE(unsafe) atomic read with no side effects - unsafe { (*Self::ptr()).sleepcnt.read() as u8 } + unsafe { (*Self::PTR).sleepcnt.read() as u8 } } /// Set the sleep count @@ -296,7 +296,7 @@ impl DWT { #[inline] pub fn lsu_count() -> u8 { // NOTE(unsafe) atomic read with no side effects - unsafe { (*Self::ptr()).lsucnt.read() as u8 } + unsafe { (*Self::PTR).lsucnt.read() as u8 } } /// Set the lsu count @@ -313,7 +313,7 @@ impl DWT { #[inline] pub fn fold_count() -> u8 { // NOTE(unsafe) atomic read with no side effects - unsafe { (*Self::ptr()).foldcnt.read() as u8 } + unsafe { (*Self::PTR).foldcnt.read() as u8 } } /// Set the folded instruction count |