Skip to content

Commit 360fb33

Browse files
committed
dwt: refactor enable_exception_tracing into enable/disable funs
1 parent 92c15ed commit 360fb33

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

Diff for: src/peripheral/dwt.rs

+15-3
Original file line numberDiff line numberDiff line change
@@ -153,13 +153,25 @@ impl DWT {
153153
self.ctrl.read().cyccntena()
154154
}
155155

156-
/// Whether to enable exception tracing
156+
/// Enables exception tracing
157157
#[cfg(not(armv6m))]
158158
#[inline]
159-
pub fn enable_exception_tracing(&mut self, bit: bool) {
159+
pub fn enable_exception_tracing(&mut self) {
160160
unsafe {
161161
self.ctrl.modify(|mut r| {
162-
r.set_exctrcena(bit);
162+
r.set_exctrcena(true);
163+
r
164+
});
165+
}
166+
}
167+
168+
/// Disables exception tracing
169+
#[cfg(not(armv6m))]
170+
#[inline]
171+
pub fn disable_exception_tracing(&mut self) {
172+
unsafe {
173+
self.ctrl.modify(|mut r| {
174+
r.set_exctrcena(false);
163175
r
164176
});
165177
}

0 commit comments

Comments
 (0)