Skip to content

Commit

Permalink
Merge embedded-hal-1 support from 'hawkw/eliza/embedded-hal-1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
sirhcel committed Oct 12, 2024
2 parents 864df53 + f7a143b commit d066074
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ pub enum Error<E> {
Crc,
}

impl<I: I2c> From<i2c::Error<I>> for Error<I::Error> {
impl<I> From<i2c::Error<I>> for Error<I::Error>
where
I: I2c,
{
fn from(err: i2c::Error<I>) -> Self {
match err {
i2c::Error::Crc => Error::Crc,
Expand Down
4 changes: 2 additions & 2 deletions src/sht4x.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use crate::{
};
use core::marker::PhantomData;
use embedded_hal::{delay::DelayNs, i2c::I2c};

use sensirion_i2c::i2c;

const RESPONSE_LEN: usize = 6;
Expand Down Expand Up @@ -44,8 +43,9 @@ impl From<Precision> for Command {
}
}

impl<I: I2c, D> Sht4x<I, D>
impl<I, D> Sht4x<I, D>
where
I: I2c,
D: DelayNs,
{
/// Creates a new driver instance using the given I2C bus. It configures the default I2C
Expand Down

0 comments on commit d066074

Please sign in to comment.