Merge pull request #77 from embassy-rs/no-reexport
Do not reexport atomic-polyfill
This commit is contained in:
commit
3b5ccb0848
8 changed files with 16 additions and 11 deletions
|
@ -157,17 +157,17 @@ pub fn interrupt_take(item: TokenStream) -> TokenStream {
|
|||
static HANDLER: ::embassy::interrupt::Handler;
|
||||
}
|
||||
|
||||
let func = HANDLER.func.load(::embassy::atomic::Ordering::Acquire);
|
||||
let ctx = HANDLER.ctx.load(::embassy::atomic::Ordering::Acquire);
|
||||
let func = HANDLER.func.load(::embassy::export::atomic::Ordering::Acquire);
|
||||
let ctx = HANDLER.ctx.load(::embassy::export::atomic::Ordering::Acquire);
|
||||
if !func.is_null() {
|
||||
let func: fn(*mut ()) = ::core::mem::transmute(func);
|
||||
func(ctx)
|
||||
}
|
||||
}
|
||||
|
||||
static TAKEN: ::embassy::atomic::AtomicBool = ::embassy::atomic::AtomicBool::new(false);
|
||||
static TAKEN: ::embassy::export::atomic::AtomicBool = ::embassy::export::atomic::AtomicBool::new(false);
|
||||
|
||||
if TAKEN.compare_exchange(false, true, ::embassy::atomic::Ordering::AcqRel, ::embassy::atomic::Ordering::Acquire).is_err() {
|
||||
if TAKEN.compare_exchange(false, true, ::embassy::export::atomic::Ordering::AcqRel, ::embassy::export::atomic::Ordering::Acquire).is_err() {
|
||||
panic!("IRQ Already taken");
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
pub use embassy_macros::task;
|
||||
|
||||
use atomic_polyfill::Ordering;
|
||||
use core::future::Future;
|
||||
use core::marker::PhantomData;
|
||||
use core::pin::Pin;
|
||||
|
@ -15,7 +16,6 @@ mod util;
|
|||
mod waker;
|
||||
|
||||
use self::util::UninitCell;
|
||||
use crate::atomic::Ordering;
|
||||
use crate::fmt::panic;
|
||||
use crate::interrupt::{Interrupt, InterruptExt};
|
||||
use crate::time::Alarm;
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
use atomic_polyfill::{AtomicU32, Ordering};
|
||||
use core::cell::Cell;
|
||||
use core::cmp::min;
|
||||
use core::marker::PhantomData;
|
||||
|
@ -9,7 +10,6 @@ use super::run_queue::{RunQueue, RunQueueItem};
|
|||
use super::timer_queue::{TimerQueue, TimerQueueItem};
|
||||
use super::util::UninitCell;
|
||||
use super::waker;
|
||||
use crate::atomic::{AtomicU32, Ordering};
|
||||
use crate::time::{Alarm, Instant};
|
||||
|
||||
/// Task is spawned (has a future)
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
use atomic_polyfill::{AtomicPtr, Ordering};
|
||||
use core::ptr;
|
||||
use core::ptr::NonNull;
|
||||
|
||||
use super::raw::Task;
|
||||
use crate::atomic::{AtomicPtr, Ordering};
|
||||
|
||||
pub(crate) struct RunQueueItem {
|
||||
next: AtomicPtr<Task>,
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
use atomic_polyfill::{AtomicPtr, Ordering};
|
||||
use core::cell::Cell;
|
||||
use core::cmp::min;
|
||||
use core::ptr;
|
||||
use core::ptr::NonNull;
|
||||
|
||||
use super::raw::{Task, STATE_TIMER_QUEUED};
|
||||
use crate::atomic::{AtomicPtr, Ordering};
|
||||
use crate::time::Instant;
|
||||
|
||||
pub(crate) struct TimerQueueItem {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use core::ptr;
|
||||
use cortex_m::peripheral::NVIC;
|
||||
|
||||
use crate::atomic::{AtomicBool, AtomicPtr, Ordering};
|
||||
use atomic_polyfill::{AtomicBool, AtomicPtr, Ordering};
|
||||
|
||||
pub use embassy_macros::interrupt_declare as declare;
|
||||
pub use embassy_macros::interrupt_take as take;
|
||||
|
|
|
@ -18,4 +18,9 @@ pub mod time;
|
|||
pub mod util;
|
||||
|
||||
pub use embassy_traits as traits;
|
||||
pub use atomic_polyfill as atomic;
|
||||
|
||||
#[doc(hidden)]
|
||||
/// Implementation details for embassy macros. DO NOT USE.
|
||||
pub mod export {
|
||||
pub use atomic_polyfill as atomic;
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use core::cell::UnsafeCell;
|
||||
use core::mem::MaybeUninit;
|
||||
|
||||
use crate::atomic::{AtomicBool, Ordering};
|
||||
use atomic_polyfill::{AtomicBool, Ordering};
|
||||
|
||||
pub struct Forever<T> {
|
||||
used: AtomicBool,
|
||||
|
|
Loading…
Reference in a new issue