Commit 757e9c7
Merge #229
229: timer: trigger update event to load the registers r=thalesfragoso a=andresv
@thalesfragoso suggested this fix in matrix.
rtic init:
```rust
let mut timer = Timer::tim5(ctx.device.TIM5, 10.hz(), clocks);
timer.listen(Event::TimeOut);
pb5.set_high().ok();
```
rtic isr:
```rust
#[task(binds = TIM5, resources = [led, sm, pb5])]
fn timer5_isr(ctx: timer5_isr::Context) {
let tim = unsafe { &(*stm32::TIM5::ptr()) };
ctx.resources.pb5.toggle().ok();
tim.sr.modify(|_, w| w.uif().clear_bit());
}
```
PB5 pin trace, notice the glitch:

With this fix timings are perfect:

Co-authored-by: Andres Vahter <andres@vahter.me>2 files changed
+6
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
263 | 263 | | |
264 | 264 | | |
265 | 265 | | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
266 | 271 | | |
267 | 272 | | |
268 | 273 | | |
| |||
0 commit comments