diff options
author | 2023-01-09 21:02:53 +0100 | |
---|---|---|
committer | 2023-03-01 00:33:29 +0100 | |
commit | cd790a94286cdc307d399b7f7a43e305e90de5bf (patch) | |
tree | 5a83dd0739c90fb848744c22bcbe689eed1f1fcf /src/export.rs | |
parent | 1eabb94f0424d7ff85786ad05615da69a379f01d (diff) | |
download | rtic-cd790a94286cdc307d399b7f7a43e305e90de5bf.tar.gz rtic-cd790a94286cdc307d399b7f7a43e305e90de5bf.tar.zst rtic-cd790a94286cdc307d399b7f7a43e305e90de5bf.zip |
More work on new spawn/executor
Diffstat (limited to 'src/export.rs')
-rw-r--r-- | src/export.rs | 25 |
1 files changed, 2 insertions, 23 deletions
diff --git a/src/export.rs b/src/export.rs index 6017dcf7..cdca9727 100644 --- a/src/export.rs +++ b/src/export.rs @@ -1,5 +1,4 @@ pub use bare_metal::CriticalSection; -use core::sync::atomic::{AtomicBool, Ordering}; pub use cortex_m::{ asm::nop, asm::wfi, @@ -7,6 +6,8 @@ pub use cortex_m::{ peripheral::{scb::SystemHandler, DWT, NVIC, SCB, SYST}, Peripherals, }; +//pub use portable_atomic as atomic; +pub use atomic_polyfill as atomic; pub mod executor; @@ -72,28 +73,6 @@ where f(); } -pub struct Barrier { - inner: AtomicBool, -} - -impl Barrier { - pub const fn new() -> Self { - Barrier { - inner: AtomicBool::new(false), - } - } - - pub fn release(&self) { - self.inner.store(true, Ordering::Release); - } - - pub fn wait(&self) { - while !self.inner.load(Ordering::Acquire) { - core::hint::spin_loop() - } - } -} - /// Const helper to check architecture pub const fn have_basepri() -> bool { #[cfg(have_basepri)] |