Skip to content

Commit 420243a

Browse files
cs2dsbTheZoq2
authored andcommitted
Changed timer stop_in_debug to modify dbg.cr instead of overwriting it
1 parent 0cb9e7d commit 420243a

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
2525
### Fixed
2626

2727
- Fix some F1 variants crashing when modifying MAPR if JTAG is disabled
28+
- Switched Timer stop_in_debug to modify cr instead of writing it to prevent it clobbering the rest of the register (was breaking ITM output when configuring pwm_input for example)
2829

2930
### Changed
3031

src/timer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ macro_rules! hal {
157157
/// Stopping timer in debug mode can cause troubles when sampling the signal
158158
#[inline(always)]
159159
pub fn stop_in_debug(&mut self, dbg: &mut DBG, state: bool) {
160-
dbg.cr.write(|w| w.$dbg_timX_stop().bit(state));
160+
dbg.cr.modify(|_, w| w.$dbg_timX_stop().bit(state));
161161
}
162162

163163
/// Releases the TIM Peripheral

0 commit comments

Comments
 (0)