2021-09-13 14:35:40 +02:00
|
|
|
#![cfg_attr(not(any(feature = "std", feature = "wasm")), no_std)]
|
2022-06-11 00:42:20 +02:00
|
|
|
#![cfg_attr(all(feature = "nightly", target_arch = "xtensa"), feature(asm_experimental_arch))]
|
2021-10-18 00:55:43 +02:00
|
|
|
#![allow(clippy::new_without_default)]
|
2022-08-17 23:40:16 +02:00
|
|
|
#![doc = include_str!("../README.md")]
|
2022-06-26 00:53:35 +02:00
|
|
|
#![warn(missing_docs)]
|
2020-09-22 18:03:43 +02:00
|
|
|
|
2020-12-01 17:46:56 +01:00
|
|
|
// This mod MUST go first, so that the others see its macros.
|
|
|
|
pub(crate) mod fmt;
|
|
|
|
|
2022-02-12 00:24:04 +01:00
|
|
|
#[cfg(feature = "nightly")]
|
|
|
|
pub use embassy_macros::{main, task};
|
2021-03-17 01:47:45 +01:00
|
|
|
|
2022-08-17 23:40:16 +02:00
|
|
|
cfg_if::cfg_if! {
|
|
|
|
if #[cfg(cortex_m)] {
|
|
|
|
#[path="arch/cortex_m.rs"]
|
|
|
|
mod arch;
|
|
|
|
pub use arch::*;
|
|
|
|
}
|
|
|
|
else if #[cfg(target_arch="riscv32")] {
|
|
|
|
#[path="arch/riscv32.rs"]
|
|
|
|
mod arch;
|
|
|
|
pub use arch::*;
|
|
|
|
}
|
|
|
|
else if #[cfg(all(target_arch="xtensa", feature = "nightly"))] {
|
|
|
|
#[path="arch/xtensa.rs"]
|
|
|
|
mod arch;
|
|
|
|
pub use arch::*;
|
|
|
|
}
|
|
|
|
else if #[cfg(feature="wasm")] {
|
|
|
|
#[path="arch/wasm.rs"]
|
|
|
|
mod arch;
|
|
|
|
pub use arch::*;
|
|
|
|
}
|
|
|
|
else if #[cfg(feature="std")] {
|
|
|
|
#[path="arch/std.rs"]
|
|
|
|
mod arch;
|
|
|
|
pub use arch::*;
|
|
|
|
}
|
2021-03-17 01:47:45 +01:00
|
|
|
}
|
2022-08-17 23:40:16 +02:00
|
|
|
|
2021-03-17 01:47:45 +01:00
|
|
|
#[doc(hidden)]
|
|
|
|
/// Implementation details for embassy macros. DO NOT USE.
|
|
|
|
pub mod export {
|
2022-08-09 22:25:42 +02:00
|
|
|
#[cfg(feature = "rtos-trace")]
|
|
|
|
pub use rtos_trace::trace;
|
|
|
|
|
|
|
|
/// Expands the given block of code when `embassy-executor` is compiled with
|
2022-08-16 06:42:08 +02:00
|
|
|
/// the `rtos-trace-interrupt` feature.
|
2022-08-09 22:25:42 +02:00
|
|
|
#[doc(hidden)]
|
|
|
|
#[macro_export]
|
2022-08-16 06:42:08 +02:00
|
|
|
#[cfg(feature = "rtos-trace-interrupt")]
|
|
|
|
macro_rules! rtos_trace_interrupt {
|
2022-08-09 22:25:42 +02:00
|
|
|
($($tt:tt)*) => { $($tt)* };
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Does not expand the given block of code when `embassy-executor` is
|
2022-08-16 06:42:08 +02:00
|
|
|
/// compiled without the `rtos-trace-interrupt` feature.
|
2022-08-09 22:25:42 +02:00
|
|
|
#[doc(hidden)]
|
|
|
|
#[macro_export]
|
2022-08-16 06:42:08 +02:00
|
|
|
#[cfg(not(feature = "rtos-trace-interrupt"))]
|
|
|
|
macro_rules! rtos_trace_interrupt {
|
2022-08-09 22:25:42 +02:00
|
|
|
($($tt:tt)*) => {};
|
|
|
|
}
|
2021-03-17 01:47:45 +01:00
|
|
|
}
|
2022-08-19 06:53:06 +02:00
|
|
|
|
2022-08-17 23:40:16 +02:00
|
|
|
pub mod raw;
|
|
|
|
|
|
|
|
mod spawner;
|
|
|
|
pub use spawner::*;
|
2022-08-22 15:51:44 +02:00
|
|
|
|
|
|
|
/// Do not use. Used for macros and HALs only. Not covered by semver guarantees.
|
|
|
|
#[doc(hidden)]
|
|
|
|
pub mod _export {
|
|
|
|
pub use static_cell::StaticCell;
|
|
|
|
}
|