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

@ -11,13 +11,13 @@ use example_common::{panic, *};
use bxcan::filter::Mask32;
use cortex_m_rt::entry;
use embassy::executor::{task, Executor};
use embassy::executor::Executor;
use embassy::util::Forever;
use embassy_stm32f4::{can, interrupt};
use stm32f4xx_hal::prelude::*;
use stm32f4xx_hal::{can::Can, stm32};
#[task]
#[embassy::task]
async fn run(dp: stm32::Peripherals, _cp: cortex_m::Peripherals) {
let gpioa = dp.GPIOA.split();

View File

@ -10,7 +10,7 @@ mod example_common;
use example_common::{panic, *};
use cortex_m_rt::entry;
use embassy::executor::{task, Executor};
use embassy::executor::Executor;
use embassy::traits::gpio::*;
use embassy::util::Forever;
use embassy_stm32f4::exti::ExtiPin;
@ -19,7 +19,7 @@ use futures::pin_mut;
use stm32f4xx_hal::prelude::*;
use stm32f4xx_hal::stm32;
#[task]
#[embassy::task]
async fn run(dp: stm32::Peripherals, _cp: cortex_m::Peripherals) {
let gpioa = dp.GPIOA.split();

View File

@ -11,12 +11,11 @@ use example_common::*;
use defmt::panic;
use embassy;
use embassy::executor::Spawner;
use embassy::task;
use embassy::time::{Duration, Timer};
use embassy_stm32f4;
use embassy_stm32f4::hal;
#[task]
#[embassy::task]
async fn run1() {
loop {
info!("BIG INFREQUENT TICK");
@ -24,7 +23,7 @@ async fn run1() {
}
}
#[task]
#[embassy::task]
async fn run2() {
loop {
info!("tick");

View File

@ -11,7 +11,7 @@ use example_common::{panic, *};
use cortex_m::singleton;
use cortex_m_rt::entry;
use embassy::executor::{task, Executor};
use embassy::executor::Executor;
use embassy::traits::uart::{Read, Write};
use embassy::util::Forever;
use embassy_stm32f4::interrupt;
@ -22,7 +22,7 @@ use stm32f4xx_hal::prelude::*;
use stm32f4xx_hal::serial::config::Config;
use stm32f4xx_hal::stm32;
#[task]
#[embassy::task]
async fn run(dp: stm32::Peripherals, _cp: cortex_m::Peripherals) {
dp.DBGMCU.cr.modify(|_, w| {
w.dbg_sleep().set_bit();

View File

@ -10,7 +10,7 @@ use example_common::*;
use cortex_m_rt::entry;
use defmt::panic;
use embassy::executor::{task, Executor};
use embassy::executor::Executor;
use embassy::interrupt::InterruptExt;
use embassy::io::{AsyncBufReadExt, AsyncWriteExt};
use embassy::time::{Duration, Timer};
@ -25,7 +25,7 @@ use stm32f4xx_hal::prelude::*;
use usb_device::bus::UsbBusAllocator;
use usb_device::prelude::*;
#[task]
#[embassy::task]
async fn run1(bus: &'static mut UsbBusAllocator<UsbBus<USB>>) {
info!("Async task");