- 
                Notifications
    You must be signed in to change notification settings 
- Fork 248
Closed
Description
Added embedded-hal-bus = "0.2.0" to my project and it failed to build.
Using target thumbv7m-none-eabi works, using target thumbv6m-none-eabi fails. Version 0.1.0 works.
Trying to build the latest master branch:
./embedded-hal-bus> cargo build --target thumbv6m-none-eabi
   Compiling embedded-hal v1.0.0 (/home/cyber/Documents/VSCode/embedded-hal/embedded-hal)
   Compiling portable-atomic v1.6.0
   Compiling embedded-io-adapters v0.6.1 (/home/cyber/Documents/VSCode/embedded-hal/embedded-io-adapters)
   Compiling embedded-io-async v0.6.1 (/home/cyber/Documents/VSCode/embedded-hal/embedded-io-async)
   Compiling embedded-hal-async v1.0.0 (/home/cyber/Documents/VSCode/embedded-hal/embedded-hal-async)
   Compiling nb v1.1.0
   Compiling embedded-io v0.6.1 (/home/cyber/Documents/VSCode/embedded-hal/embedded-io)
   Compiling embedded-hal-bus v0.2.0 (/home/cyber/Documents/VSCode/embedded-hal/embedded-hal-bus)
   Compiling critical-section v1.1.2
   Compiling embedded-can v0.4.1 (/home/cyber/Documents/VSCode/embedded-hal/embedded-can)
   Compiling embedded-hal-nb v1.0.0 (/home/cyber/Documents/VSCode/embedded-hal/embedded-hal-nb)
error[E0599]: no method named `compare_exchange` found for struct `portable_atomic::AtomicBool` in the current scope
   --> embedded-hal-bus/src/i2c/atomic.rs:122:14
    |
120 | /         self.bus
121 | |             .busy
122 | |             .compare_exchange(
    | |             -^^^^^^^^^^^^^^^^ method not found in `AtomicBool`
    | |_____________|
    | 
error[E0599]: no method named `compare_exchange` found for struct `portable_atomic::AtomicBool` in the current scope
   --> embedded-hal-bus/src/spi/atomic.rs:127:14
    |
125 | /         self.bus
126 | |             .busy
127 | |             .compare_exchange(
    | |             -^^^^^^^^^^^^^^^^ method not found in `AtomicBool`
    | |_____________|
    | 
For more information about this error, try `rustc --explain E0599`.
error: could not compile `embedded-hal-bus` (lib) due to 2 previous errors
Seems to be caused by #593
embedded-hal/embedded-hal-bus/src/spi/atomic.rs
Lines 125 to 133 in a0ccb65
| self.bus | |
| .busy | |
| .compare_exchange( | |
| false, | |
| true, | |
| core::sync::atomic::Ordering::SeqCst, | |
| core::sync::atomic::Ordering::SeqCst, | |
| ) | |
| .map_err(|_| AtomicError::Busy)?; | 
embedded-hal/embedded-hal-bus/src/i2c/atomic.rs
Lines 120 to 128 in a0ccb65
| self.bus | |
| .busy | |
| .compare_exchange( | |
| false, | |
| true, | |
| core::sync::atomic::Ordering::SeqCst, | |
| core::sync::atomic::Ordering::SeqCst, | |
| ) | |
| .map_err(|_| AtomicError::<T::Error>::Busy)?; | 
ARMv6-M does not have atomic CAS, so portable_atomic does not implement AtomicBool::compare_exchange on this target.
Metadata
Metadata
Assignees
Labels
No labels