From e8f7faaed96037b4ffb1eff9f13838ee03bb4580 Mon Sep 17 00:00:00 2001 From: 9names <60134748+9names@users.noreply.github.com> Date: Wed, 10 Jan 2024 19:09:29 +1100 Subject: [PATCH] Update to embedded-hal 1.0 release (#51) --- Cargo.toml | 4 ++-- src/delay.rs | 2 +- src/gpio.rs | 13 +------------ 3 files changed, 4 insertions(+), 15 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 199149d..b6b17e2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,8 +11,8 @@ description = "HAL for the bl602 microcontroller" [dependencies] bl602-pac = { git = "https://github.com/sipeed/bl602-pac", branch = "main" } -embedded-hal = "=1.0.0-rc.3" -embedded-hal-nb = "=1.0.0-rc.3" +embedded-hal = "1" +embedded-hal-nb = "1" embedded-time = "0.12.0" riscv = "0.10.1" nb = "1.0" diff --git a/src/delay.rs b/src/delay.rs index e6c4a5e..98d12e8 100644 --- a/src/delay.rs +++ b/src/delay.rs @@ -17,7 +17,7 @@ pub struct McycleDelay { impl McycleDelay { /// Constructs the delay provider based on core clock frequency `freq` pub fn new(freq: u32) -> Self { - Self { + Self { core_frequency: freq, } } diff --git a/src/gpio.rs b/src/gpio.rs index 55b0575..5be1ab0 100644 --- a/src/gpio.rs +++ b/src/gpio.rs @@ -280,7 +280,7 @@ macro_rules! impl_glb { pub mod pin { use core::marker::PhantomData; use core::convert::Infallible; - use embedded_hal::digital::{InputPin, OutputPin, StatefulOutputPin, ToggleableOutputPin}; + use embedded_hal::digital::{InputPin, OutputPin, StatefulOutputPin}; use embedded_hal_zero::digital::v2::{ InputPin as InputPinZero, OutputPin as OutputPinZero, @@ -590,17 +590,6 @@ macro_rules! impl_glb { } - impl ToggleableOutputPin for $Pini> { - fn toggle(&mut self) -> Result<(), Self::Error> { - if self.is_output_high_inner() { - self.set_low_inner() - } else { - self.set_high_inner() - } - Ok(()) - } - } - impl ToggleableOutputPinZero for $Pini> { type Error = Infallible;