Skip to content

Commit 8f410db

Browse files
bors[bot]revyakin
andauthored
161: Provide ability to clear timer UIF interrup flag r=therealprof a=revyakin Timer interrupts cannot be used without this method. Co-authored-by: Evgeniy Revyakin <[email protected]>
2 parents f651e6e + bc36671 commit 8f410db

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1414
### Added
1515

1616
- Provide getters to serial status flags idle/txe/rxne/tc.
17+
- Provide ability to reset timer UIF interrupt flag
1718

1819
### Fixed
1920

src/timers.rs

+5
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,11 @@ macro_rules! timers {
168168
rcc.$apbenr.modify(|_, w| w.$timXen().clear_bit());
169169
self.tim
170170
}
171+
172+
/// Clears interrupt flag
173+
pub fn clear_irq(&mut self) {
174+
self.tim.sr.modify(|_, w| w.uif().clear_bit());
175+
}
171176
}
172177

173178
impl CountDown for Timer<$TIM> {

0 commit comments

Comments
 (0)