diff options
author | 2021-11-27 10:32:37 +0100 | |
---|---|---|
committer | 2021-11-27 10:32:37 +0100 | |
commit | 360fb334c7cec241ca4e396b5ab23c58fb8905fe (patch) | |
tree | e4664f59ccb0df5f604fc5afb7532cfd2214c49c /src | |
parent | 92c15ed56da6331c1f7bc4bb1372b56e3fc93a05 (diff) | |
download | cortex-m-360fb334c7cec241ca4e396b5ab23c58fb8905fe.tar.gz cortex-m-360fb334c7cec241ca4e396b5ab23c58fb8905fe.tar.zst cortex-m-360fb334c7cec241ca4e396b5ab23c58fb8905fe.zip |
dwt: refactor enable_exception_tracing into enable/disable funs
Diffstat (limited to 'src')
-rw-r--r-- | src/peripheral/dwt.rs | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/peripheral/dwt.rs b/src/peripheral/dwt.rs index 7fc9478..11dd545 100644 --- a/src/peripheral/dwt.rs +++ b/src/peripheral/dwt.rs @@ -153,13 +153,25 @@ impl DWT { self.ctrl.read().cyccntena() } - /// Whether to enable exception tracing + /// Enables exception tracing #[cfg(not(armv6m))] #[inline] - pub fn enable_exception_tracing(&mut self, bit: bool) { + pub fn enable_exception_tracing(&mut self) { unsafe { self.ctrl.modify(|mut r| { - r.set_exctrcena(bit); + r.set_exctrcena(true); + r + }); + } + } + + /// Disables exception tracing + #[cfg(not(armv6m))] + #[inline] + pub fn disable_exception_tracing(&mut self) { + unsafe { + self.ctrl.modify(|mut r| { + r.set_exctrcena(false); r }); } |