Skip to content

Commit

Permalink
Update example to embedded-hal 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ne0h authored and marcelbuesing committed Oct 28, 2024
1 parent 125a158 commit 174ed31
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ tokio = {version = "1.5", features = ["full"] }
url = "2.1"

[target.'cfg(target_os = "linux")'.dev-dependencies]
linux-embedded-hal = "0.4.0-alpha.1"
linux-embedded-hal = "0.4.0"
24 changes: 12 additions & 12 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,39 +19,39 @@
//!
//! # mod hal {
//! # use super::*;
//! # use embedded_hal::blocking::delay;
//! # use embedded_hal::delay;
//! #
//! # #[derive(Debug)]
//! # pub struct Delay {}
//! #
//! # impl delay::DelayNs for Delay {
//! # fn delay_ms(&mut self, _ms: u32) {}
//! # fn delay_ns(&mut self, _ns: u32) {}
//! # }
//! #
//! # #[derive(Debug)]
//! # pub enum I2CError {}
//! #
//! # pub struct I2cdev {}
//! #
//! # impl i2c::Write for I2cdev {
//! # type Error = I2CError;
//! #
//! # fn write<'w>(&mut self, addr: u8, bytes: &'w [u8]) -> result::Result<(), Self::Error> {
//! # Ok(())
//! # impl i2c::Error for I2CError {
//! # fn kind(&self) -> i2c::ErrorKind {
//! # i2c::ErrorKind::Other
//! # }
//! # }
//! #
//! # impl i2c::Read for I2cdev {
//! # pub struct I2cdev {}
//! #
//! # impl i2c::ErrorType for I2cdev {
//! # type Error = I2CError;
//! # }
//! #
//! # fn read<'w>(&mut self, addr: u8, bytes: &'w mut [u8]) -> result::Result<(), Self::Error> {
//! # impl i2c::I2c for I2cdev {
//! # fn transaction(&mut self, addr: u8, operations: &mut [i2c::Operation]) -> Result<(), Self::Error> {
//! # Ok(())
//! # }
//! # }
//! # }
//!
//! fn main() -> result::Result<(), Error<embedded_hal::i2c::I2c::Error>>
//! {
//! fn main() -> result::Result<(), bme680::Error<I2CError>> {
//! // Initialize device
//! let i2c = I2cdev {}; // Your I2C device construction will look different, perhaps using I2cdev::new(..)
//! let mut delayer = Delay {}; // Your Delay construction will look different, perhaps using Delay::new(..)
Expand Down

0 comments on commit 174ed31

Please sign in to comment.