We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 718cd17 commit a7e62b6Copy full SHA for a7e62b6
src/peripheral/dwt.rs
@@ -75,4 +75,13 @@ impl DWT {
75
// NOTE(unsafe) atomic read with no side effects
76
unsafe { (*Self::ptr()).cyccnt.read() }
77
}
78
+
79
+ /// Removes the software lock on the DWT
80
+ ///
81
+ /// Some devices, like the STM32F7, software lock the DWT after a power cycle.
82
+ #[cfg(not(armv6m))]
83
+ pub fn unlock() {
84
+ // NOTE(unsafe) atomic write to a stateless, write-only register
85
+ unsafe { (*Self::ptr()).lar.write(0xC5ACCE55) }
86
+ }
87
0 commit comments