From 45dc286f860dad17b001d54e49a6e4a72722b963 Mon Sep 17 00:00:00 2001 From: Levi Pearson Date: Wed, 9 Mar 2022 03:32:19 -0700 Subject: [PATCH] Update hal to 0.9.0 --- Cargo.toml | 2 +- src/main.rs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index f88f913..f398e8d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,7 @@ cortex-m = "0.7.4" cortex-m-rt = "0.7.1" embedded-hal = "0.2.4" nb = "1.0.0" -stm32f1xx-hal = { version = "0.8.0", features = ["rt", "stm32f103", "medium"] } +stm32f1xx-hal = { version = "0.9.0", features = ["rt", "stm32f103", "medium"] } rtt-target = { version = "0.3.1", features = ["cortex-m"] } panic-rtt-target = { version = "0.1.0", features = ["cortex-m"] } # alternate panic impls, choose only one! diff --git a/src/main.rs b/src/main.rs index 6e53242..7b05d0c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -42,7 +42,8 @@ fn main() -> ! { // in order to configure the port. For pins 0-7, crl should be passed instead. let mut led = gpioc.pc13.into_push_pull_output(&mut gpioc.crh); // Configure the syst timer to trigger an update every second - let mut timer = Timer::syst(cp.SYST, &clocks).start_count_down(1.hz()); + let mut timer = Timer::syst(cp.SYST, &clocks).counter_hz(); + timer.start(1.Hz()).unwrap(); rprintln!("Hello, Rust!"); // Wait for the timer to trigger an update and change the state of the LED