Skip to content

Commit

Permalink
Update to embedded-hal 1.0 release (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
9names authored Jan 10, 2024
1 parent eeb35ff commit e8f7faa
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 15 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion src/delay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
}
Expand Down
13 changes: 1 addition & 12 deletions src/gpio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -590,17 +590,6 @@ macro_rules! impl_glb {
}


impl<MODE> ToggleableOutputPin for $Pini<Output<MODE>> {
fn toggle(&mut self) -> Result<(), Self::Error> {
if self.is_output_high_inner() {
self.set_low_inner()
} else {
self.set_high_inner()
}
Ok(())
}
}

impl<MODE> ToggleableOutputPinZero for $Pini<Output<MODE>> {
type Error = Infallible;

Expand Down

0 comments on commit e8f7faa

Please sign in to comment.