diff options
author | Dario Nieuwenhuis <dirbaio@dirbaio.net> | 2021-01-20 20:41:39 +0100 |
---|---|---|
committer | Dario Nieuwenhuis <dirbaio@dirbaio.net> | 2021-02-03 05:43:42 +0100 |
commit | d795a93900d1760c1a4296377557918e464d72ba (patch) | |
tree | 428e20ceaa04a7cabad88f038173ae80f51daad2 /nrf-softdevice/src/softdevice.rs | |
parent | a7508c0ee43b525d07f075c734ddcf8e60797ae4 (diff) | |
download | nrf-softdevice-d795a93900d1760c1a4296377557918e464d72ba.zip |
Remove use of deprecated compare_and_swap
Diffstat (limited to 'nrf-softdevice/src/softdevice.rs')
-rw-r--r-- | nrf-softdevice/src/softdevice.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/nrf-softdevice/src/softdevice.rs b/nrf-softdevice/src/softdevice.rs index 52ab002..d62e014 100644 --- a/nrf-softdevice/src/softdevice.rs +++ b/nrf-softdevice/src/softdevice.rs @@ -110,7 +110,10 @@ impl Softdevice { /// - Panics if the requested configuration has too high memory requirements for the softdevice. The softdevice supports a maximum dynamic memory size of 64kb. /// - Panics if called multiple times. Must be called at most once. pub fn enable(_peripherals: Peripherals, config: &Config) -> &'static Softdevice { - if ENABLED.compare_and_swap(false, true, Ordering::AcqRel) { + if ENABLED + .compare_exchange(false, true, Ordering::AcqRel, Ordering::Acquire) + .is_err() + { panic!("nrf_softdevice::enable() called multiple times.") } |