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