Reexport macros at root, use eveywhere as #[embassy::task]

This commit is contained in:
Dario Nieuwenhuis
2021-03-29 03:00:48 +02:00
parent d5ab02792c
commit d7c3a38efc
15 changed files with 29 additions and 34 deletions

View File

@ -1,5 +1,3 @@
pub use embassy_macros::{main, task};
use core::marker::PhantomData;
use core::ptr::NonNull;
use core::{mem, ptr};

View File

@ -60,7 +60,7 @@ impl Timer {
/// use embassy::executor::task;
/// use embassy::time::{Duration, Timer};
///
/// #[task]
/// #[embassy::task]
/// async fn demo_sleep_seconds() {
/// // suspend this task for one second.
/// Timer::after(Duration::from_secs(1)).await;
@ -104,7 +104,7 @@ impl Future for Timer {
/// use embassy::time::{Duration, Timer};
/// # fn foo() {}
///
/// #[task]
/// #[embassy::task]
/// async fn ticker_example_0() {
/// loop {
/// foo();
@ -129,7 +129,7 @@ impl Future for Timer {
/// use futures::StreamExt;
/// # fn foo(){}
///
/// #[task]
/// #[embassy::task]
/// async fn ticker_example_1() {
/// let mut ticker = Ticker::every(Duration::from_secs(1));
/// loop {

View File

@ -17,8 +17,8 @@ pub mod io;
pub mod time;
pub mod util;
pub use embassy_macros::*;
pub use embassy_traits as traits;
pub use executor::{main, task};
#[doc(hidden)]
/// Implementation details for embassy macros. DO NOT USE.

View File

@ -122,7 +122,7 @@ unsafe impl cortex_m::interrupt::Nr for NrWrap {
/// use embassy::util::InterruptFuture;
/// use embassy::executor::task;
/// use embassy_stm32f4::interrupt; // Adjust this to your MCU's embassy HAL.
/// #[task]
/// #[embassy::task]
/// async fn demo_interrupt_future() {
/// // Using STM32f446 interrupt names, adjust this to your application as necessary.
/// // Wait for TIM2 to tick.