@@ -15,8 +15,18 @@ repository = "https://github.com/rust-embedded/embedded-hal"
1515version = " 0.2.0"
1616
1717[features ]
18+ # Enable shared bus implementations using `std::sync::Mutex`, and implement `std::error::Error` for `DeviceError`
1819std = [" alloc" ]
20+ # Use `portable-atomic` to enable `atomic-device` on devices without native atomic CAS
21+ #
22+ # `portable-atomic` emulates atomic CAS functionality, allowing `embedded-hal-bus` to use `atomic-device` on hardware
23+ # that does not natively support atomic CAS. If you enable this, you must also add `portable-atomic` to your crate with
24+ # a feature flag such as `unsafe-assume-single-core` or `critical-section` to choose how atomic CAS is implemented.
25+ # See https://docs.rs/portable-atomic/1.7.0/portable_atomic/#optional-features for more info.
26+ portable-atomic = [" dep:portable-atomic" ]
27+ # Enable `embedded-hal-async` support.
1928async = [" dep:embedded-hal-async" ]
29+ # Derive `defmt::Format` from `defmt` 0.3 for enums and structs. See https://github.com/knurling-rs/defmt for more info
2030defmt-03 = [" dep:defmt-03" , " embedded-hal/defmt-03" , " embedded-hal-async?/defmt-03" ]
2131# Enables additional utilities requiring a global allocator.
2232alloc = []
@@ -26,7 +36,7 @@ embedded-hal = { version = "1.0.0", path = "../embedded-hal" }
2636embedded-hal-async = { version = " 1.0.0" , path = " ../embedded-hal-async" , optional = true }
2737critical-section = { version = " 1.0" }
2838defmt-03 = { package = " defmt" , version = " 0.3" , optional = true }
29- portable-atomic = {version = " 1" , default-features = false }
39+ portable-atomic = {version = " 1.3 " , default-features = false , optional = true , features = [ " require-cas " ] }
3040
3141[package .metadata .docs .rs ]
3242features = [" std" , " async" ]
0 commit comments