Skip to content

Commit 8b5de51

Browse files
committed
Bump HAL for getting MonoTimer back
It got accidentally removed from the HAL an is back again. See stm32-rs/stm32f3xx-hal#247 for details.
1 parent 08629ed commit 8b5de51

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ accelerometer = "0.12.0"
3232
# For the stm32f303vc mcu
3333
[dependencies.stm32f3xx-hal]
3434
features = ["stm32f303xc", "rt"]
35-
version = "0.7.0"
35+
version = "0.8.0"
3636

3737
[dev-dependencies]
3838
panic-halt = "0.2.0"

examples/blinky_int.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ static TIM: Mutex<RefCell<Option<Timer<pac::TIM7>>>> = Mutex::new(RefCell::new(N
2727
fn TIM7() {
2828
free(|cs| {
2929
if let Some(ref mut tim7) = TIM.borrow(cs).borrow_mut().deref_mut() {
30-
tim7.clear_update_interrupt_flag()
30+
tim7.clear_event(Event::Update);
3131
}
3232
});
3333
}
@@ -39,8 +39,9 @@ fn main() -> ! {
3939
let mut rcc = peripherals.RCC.constrain();
4040

4141
let clocks = rcc.cfgr.freeze(&mut flash.acr);
42-
let mut timer = Timer::tim7(peripherals.TIM7, 2.Hz(), clocks, &mut rcc.apb1);
43-
timer.listen(Event::Update);
42+
let mut timer = Timer::new(peripherals.TIM7, clocks, &mut rcc.apb1);
43+
timer.start(500u32.milliseconds());
44+
timer.enable_interrupt(Event::Update);
4445
free(|cs| {
4546
TIM.borrow(cs).replace(Some(timer));
4647
});

0 commit comments

Comments
 (0)