Add support for rtos-trace behind a feature flag

This commit is contained in:
Quentin Smith
2022-08-09 16:25:42 -04:00
parent b7b4c84067
commit a3c1522ce6
4 changed files with 64 additions and 1 deletions

View File

@@ -19,4 +19,25 @@ pub use embassy_macros::{main, task};
/// Implementation details for embassy macros. DO NOT USE.
pub mod export {
pub use atomic_polyfill as atomic;
#[cfg(feature = "rtos-trace")]
pub use rtos_trace::trace;
/// Expands the given block of code when `embassy-executor` is compiled with
/// the `rtos-trace` feature.
#[doc(hidden)]
#[macro_export]
#[cfg(feature = "rtos-trace")]
macro_rules! rtos_trace {
($($tt:tt)*) => { $($tt)* };
}
/// Does not expand the given block of code when `embassy-executor` is
/// compiled without the `rtos-trace` feature.
#[doc(hidden)]
#[macro_export]
#[cfg(not(feature = "rtos-trace"))]
macro_rules! rtos_trace {
($($tt:tt)*) => {};
}
}