We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bb41983 commit 52b895fCopy full SHA for 52b895f
CHANGELOG.md
@@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
13
- Exception overhead counter
14
- LSU counter
15
- Folded-instruction counter
16
+- Added `DWT.set_cycle_count` (#347).
17
18
### Deprecated
19
src/peripheral/dwt.rs
@@ -160,6 +160,13 @@ impl DWT {
160
unsafe { (*Self::ptr()).cyccnt.read() }
161
}
162
163
+ /// Set the cycle count
164
+ #[cfg(not(armv6m))]
165
+ #[inline]
166
+ pub fn set_cycle_count(&mut self, count: u32) {
167
+ unsafe { self.cyccnt.write(count) }
168
+ }
169
+
170
/// Removes the software lock on the DWT
171
///
172
/// Some devices, like the STM32F7, software lock the DWT after a power cycle.
0 commit comments