Skip to content

Commit 20a0007

Browse files
committed
Add DWT.set_cycle_count
1 parent ea91f18 commit 20a0007

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
77

88
## [Unreleased]
99

10+
### Added
11+
12+
- Added `DWT.set_cycle_count` (#347).
13+
1014
## [v0.7.3] - 2021-07-03
1115

1216
### Fixed

src/peripheral/dwt.rs

+7
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,13 @@ impl DWT {
8585
unsafe { (*Self::ptr()).cyccnt.read() }
8686
}
8787

88+
/// Set the cycle count
89+
#[cfg(not(armv6m))]
90+
#[inline]
91+
pub fn set_cycle_count(&mut self, count: u32) {
92+
unsafe { self.cyccnt.write(count) }
93+
}
94+
8895
/// Removes the software lock on the DWT
8996
///
9097
/// Some devices, like the STM32F7, software lock the DWT after a power cycle.

0 commit comments

Comments
 (0)