@@ -15,8 +15,18 @@ repository = "https://github.com/rust-embedded/embedded-hal"
15
15
version = " 0.2.0"
16
16
17
17
[features ]
18
+ # Enable shared bus implementations using `std::sync::Mutex`, and implement `std::error::Error` for `DeviceError`
18
19
std = [" 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.
19
28
async = [" 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
20
30
defmt-03 = [" dep:defmt-03" , " embedded-hal/defmt-03" , " embedded-hal-async?/defmt-03" ]
21
31
# Enables additional utilities requiring a global allocator.
22
32
alloc = []
@@ -26,7 +36,7 @@ embedded-hal = { version = "1.0.0", path = "../embedded-hal" }
26
36
embedded-hal-async = { version = " 1.0.0" , path = " ../embedded-hal-async" , optional = true }
27
37
critical-section = { version = " 1.0" }
28
38
defmt-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 " ] }
30
40
31
41
[package .metadata .docs .rs ]
32
42
features = [" std" , " async" ]
0 commit comments