Skip to content

Commit 45c7f1b

Browse files
Merge pull request #44 from sirhcel/monotimer-from-hal
Bump HAL to get MonoTimer back
2 parents aff8a7a + d967bde commit 45c7f1b

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

.cargo/config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# runner = "arm-none-eabi-gdb -q -x openocd.gdb"
55
# runner = "gdb-multiarch -q -x openocd.gdb"
66
# runner = "gdb -q -x openocd.gdb"
7+
# runner = "probe-run --chip STM32F303VCTx --connect-under-reset"
78

89
rustflags = [
910
# LLD (shipped with the Rust toolchain) is used as the default linker

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"

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ dual licensed as above, without any additional terms or conditions.
6161

6262
## Changelog
6363

64+
### Unreleased
65+
66+
- Bump HAL to 0.8.0 for getting back [`MonoTimer`](https://docs.rs/stm32f3xx-hal/0.8.0/stm32f3xx_hal/timer/struct.MonoTimer.html) which was accidentially droped with release 0.6.1 and came back with the latest release.
67+
6468
### 0.7.2
6569

6670
Implements the [Accelerometer trait](https://docs.rs/accelerometer/latest/accelerometer/trait.Accelerometer.html) from the [Accelerometer crate](https://crates.io/crates/accelerometer).
@@ -123,4 +127,4 @@ For details, see the [stm32f3xx-hal changelog](https://github.com/stm32-rs/stm32
123127

124128
### 0.3.2
125129

126-
- Re-export `lsm303dhlc` driver
130+
- Re-export `lsm303dhlc` driver

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)