Skip to content

Commit

Permalink
explicit illegal no sync/async features
Browse files Browse the repository at this point in the history
  • Loading branch information
Georges760 committed Sep 2, 2024
1 parent 924d5e3 commit 764656e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ version = "0.1.0"

[dependencies]
defmt = { version = "0.3", optional = true }
embedded-hal = { version = "1.0" }
embedded-hal = { version = "1.0", optional = true }
embedded-hal-async = { version = "1.0", optional = true }
log = { version = "0.4", optional = true }
maybe-async-cfg = "0.2"
Expand All @@ -22,7 +22,7 @@ maybe-async-cfg = "0.2"
async = ["dep:embedded-hal-async"]
default = ["sync"]
defmt-03 = ["dep:defmt"]
sync = []
sync = ["dep:embedded-hal"]

[dev-dependencies]
embedded-hal-mock = { version = "0.11.1", default-features = false, features = [
Expand Down
3 changes: 3 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ pub(crate) mod fmt;
mod error;
pub use error::{Error, Result};

#[cfg(not(any(feature = "sync", feature = "async")))]
compile_error!("You should probably choose at least one of `sync` and `async` features.");

#[cfg(feature = "sync")]
use embedded_hal::i2c::ErrorType;
#[cfg(feature = "async")]
Expand Down

0 comments on commit 764656e

Please sign in to comment.