aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Alex Martens <alexmgit@protonmail.com> 2021-08-05 20:55:46 -0700
committerGravatar Alex Martens <alexmgit@protonmail.com> 2021-08-14 13:01:54 -0700
commit52b895f715016083096363cc0059ff2e5338a603 (patch)
treec8d70eb4f366ec84195ec287215f34ee0c82bb98 /src
parentbb41983ad51a8d6bbde70507358b792cdbdbd3be (diff)
downloadcortex-m-52b895f715016083096363cc0059ff2e5338a603.tar.gz
cortex-m-52b895f715016083096363cc0059ff2e5338a603.tar.zst
cortex-m-52b895f715016083096363cc0059ff2e5338a603.zip
Add DWT.set_cycle_count
Diffstat (limited to 'src')
-rw-r--r--src/peripheral/dwt.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/peripheral/dwt.rs b/src/peripheral/dwt.rs
index 21af4f1..9e8e638 100644
--- a/src/peripheral/dwt.rs
+++ b/src/peripheral/dwt.rs
@@ -160,6 +160,13 @@ impl DWT {
unsafe { (*Self::ptr()).cyccnt.read() }
}
+ /// Set the cycle count
+ #[cfg(not(armv6m))]
+ #[inline]
+ pub fn set_cycle_count(&mut self, count: u32) {
+ unsafe { self.cyccnt.write(count) }
+ }
+
/// Removes the software lock on the DWT
///
/// Some devices, like the STM32F7, software lock the DWT after a power cycle.