diff options
| author | Dario Nieuwenhuis <[email protected]> | 2021-03-29 03:00:48 +0200 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2021-03-29 03:00:48 +0200 |
| commit | d7c3a38efceacbd5a326c84c6e0bbef44b06e97c (patch) | |
| tree | 710b6553a45b99719288ab9de9084e0a93554cee /embassy-stm32f4-examples/src/bin | |
| parent | d5ab02792c5489668bd399ac094900f5e26b3420 (diff) | |
Reexport macros at root, use eveywhere as `#[embassy::task]`
Diffstat (limited to 'embassy-stm32f4-examples/src/bin')
| -rw-r--r-- | embassy-stm32f4-examples/src/bin/can.rs | 4 | ||||
| -rw-r--r-- | embassy-stm32f4-examples/src/bin/exti.rs | 4 | ||||
| -rw-r--r-- | embassy-stm32f4-examples/src/bin/rtc_async.rs | 5 | ||||
| -rw-r--r-- | embassy-stm32f4-examples/src/bin/serial.rs | 4 | ||||
| -rw-r--r-- | embassy-stm32f4-examples/src/bin/usb_serial.rs | 4 |
5 files changed, 10 insertions, 11 deletions
diff --git a/embassy-stm32f4-examples/src/bin/can.rs b/embassy-stm32f4-examples/src/bin/can.rs index 5ffde2471..c34c0a2a4 100644 --- a/embassy-stm32f4-examples/src/bin/can.rs +++ b/embassy-stm32f4-examples/src/bin/can.rs | |||
| @@ -11,13 +11,13 @@ use example_common::{panic, *}; | |||
| 11 | 11 | ||
| 12 | use bxcan::filter::Mask32; | 12 | use bxcan::filter::Mask32; |
| 13 | use cortex_m_rt::entry; | 13 | use cortex_m_rt::entry; |
| 14 | use embassy::executor::{task, Executor}; | 14 | use embassy::executor::Executor; |
| 15 | use embassy::util::Forever; | 15 | use embassy::util::Forever; |
| 16 | use embassy_stm32f4::{can, interrupt}; | 16 | use embassy_stm32f4::{can, interrupt}; |
| 17 | use stm32f4xx_hal::prelude::*; | 17 | use stm32f4xx_hal::prelude::*; |
| 18 | use stm32f4xx_hal::{can::Can, stm32}; | 18 | use stm32f4xx_hal::{can::Can, stm32}; |
| 19 | 19 | ||
| 20 | #[task] | 20 | #[embassy::task] |
| 21 | async fn run(dp: stm32::Peripherals, _cp: cortex_m::Peripherals) { | 21 | async fn run(dp: stm32::Peripherals, _cp: cortex_m::Peripherals) { |
| 22 | let gpioa = dp.GPIOA.split(); | 22 | let gpioa = dp.GPIOA.split(); |
| 23 | 23 | ||
diff --git a/embassy-stm32f4-examples/src/bin/exti.rs b/embassy-stm32f4-examples/src/bin/exti.rs index 9b2535b1c..9879de408 100644 --- a/embassy-stm32f4-examples/src/bin/exti.rs +++ b/embassy-stm32f4-examples/src/bin/exti.rs | |||
| @@ -10,7 +10,7 @@ mod example_common; | |||
| 10 | use example_common::{panic, *}; | 10 | use example_common::{panic, *}; |
| 11 | 11 | ||
| 12 | use cortex_m_rt::entry; | 12 | use cortex_m_rt::entry; |
| 13 | use embassy::executor::{task, Executor}; | 13 | use embassy::executor::Executor; |
| 14 | use embassy::traits::gpio::*; | 14 | use embassy::traits::gpio::*; |
| 15 | use embassy::util::Forever; | 15 | use embassy::util::Forever; |
| 16 | use embassy_stm32f4::exti::ExtiPin; | 16 | use embassy_stm32f4::exti::ExtiPin; |
| @@ -19,7 +19,7 @@ use futures::pin_mut; | |||
| 19 | use stm32f4xx_hal::prelude::*; | 19 | use stm32f4xx_hal::prelude::*; |
| 20 | use stm32f4xx_hal::stm32; | 20 | use stm32f4xx_hal::stm32; |
| 21 | 21 | ||
| 22 | #[task] | 22 | #[embassy::task] |
| 23 | async fn run(dp: stm32::Peripherals, _cp: cortex_m::Peripherals) { | 23 | async fn run(dp: stm32::Peripherals, _cp: cortex_m::Peripherals) { |
| 24 | let gpioa = dp.GPIOA.split(); | 24 | let gpioa = dp.GPIOA.split(); |
| 25 | 25 | ||
diff --git a/embassy-stm32f4-examples/src/bin/rtc_async.rs b/embassy-stm32f4-examples/src/bin/rtc_async.rs index 1927d01bf..f2757294d 100644 --- a/embassy-stm32f4-examples/src/bin/rtc_async.rs +++ b/embassy-stm32f4-examples/src/bin/rtc_async.rs | |||
| @@ -11,12 +11,11 @@ use example_common::*; | |||
| 11 | use defmt::panic; | 11 | use defmt::panic; |
| 12 | use embassy; | 12 | use embassy; |
| 13 | use embassy::executor::Spawner; | 13 | use embassy::executor::Spawner; |
| 14 | use embassy::task; | ||
| 15 | use embassy::time::{Duration, Timer}; | 14 | use embassy::time::{Duration, Timer}; |
| 16 | use embassy_stm32f4; | 15 | use embassy_stm32f4; |
| 17 | use embassy_stm32f4::hal; | 16 | use embassy_stm32f4::hal; |
| 18 | 17 | ||
| 19 | #[task] | 18 | #[embassy::task] |
| 20 | async fn run1() { | 19 | async fn run1() { |
| 21 | loop { | 20 | loop { |
| 22 | info!("BIG INFREQUENT TICK"); | 21 | info!("BIG INFREQUENT TICK"); |
| @@ -24,7 +23,7 @@ async fn run1() { | |||
| 24 | } | 23 | } |
| 25 | } | 24 | } |
| 26 | 25 | ||
| 27 | #[task] | 26 | #[embassy::task] |
| 28 | async fn run2() { | 27 | async fn run2() { |
| 29 | loop { | 28 | loop { |
| 30 | info!("tick"); | 29 | info!("tick"); |
diff --git a/embassy-stm32f4-examples/src/bin/serial.rs b/embassy-stm32f4-examples/src/bin/serial.rs index c8e7f288f..925fd68ff 100644 --- a/embassy-stm32f4-examples/src/bin/serial.rs +++ b/embassy-stm32f4-examples/src/bin/serial.rs | |||
| @@ -11,7 +11,7 @@ use example_common::{panic, *}; | |||
| 11 | 11 | ||
| 12 | use cortex_m::singleton; | 12 | use cortex_m::singleton; |
| 13 | use cortex_m_rt::entry; | 13 | use cortex_m_rt::entry; |
| 14 | use embassy::executor::{task, Executor}; | 14 | use embassy::executor::Executor; |
| 15 | use embassy::traits::uart::{Read, Write}; | 15 | use embassy::traits::uart::{Read, Write}; |
| 16 | use embassy::util::Forever; | 16 | use embassy::util::Forever; |
| 17 | use embassy_stm32f4::interrupt; | 17 | use embassy_stm32f4::interrupt; |
| @@ -22,7 +22,7 @@ use stm32f4xx_hal::prelude::*; | |||
| 22 | use stm32f4xx_hal::serial::config::Config; | 22 | use stm32f4xx_hal::serial::config::Config; |
| 23 | use stm32f4xx_hal::stm32; | 23 | use stm32f4xx_hal::stm32; |
| 24 | 24 | ||
| 25 | #[task] | 25 | #[embassy::task] |
| 26 | async fn run(dp: stm32::Peripherals, _cp: cortex_m::Peripherals) { | 26 | async fn run(dp: stm32::Peripherals, _cp: cortex_m::Peripherals) { |
| 27 | dp.DBGMCU.cr.modify(|_, w| { | 27 | dp.DBGMCU.cr.modify(|_, w| { |
| 28 | w.dbg_sleep().set_bit(); | 28 | w.dbg_sleep().set_bit(); |
diff --git a/embassy-stm32f4-examples/src/bin/usb_serial.rs b/embassy-stm32f4-examples/src/bin/usb_serial.rs index f1c4631d7..6d3b2cc14 100644 --- a/embassy-stm32f4-examples/src/bin/usb_serial.rs +++ b/embassy-stm32f4-examples/src/bin/usb_serial.rs | |||
| @@ -10,7 +10,7 @@ use example_common::*; | |||
| 10 | 10 | ||
| 11 | use cortex_m_rt::entry; | 11 | use cortex_m_rt::entry; |
| 12 | use defmt::panic; | 12 | use defmt::panic; |
| 13 | use embassy::executor::{task, Executor}; | 13 | use embassy::executor::Executor; |
| 14 | use embassy::interrupt::InterruptExt; | 14 | use embassy::interrupt::InterruptExt; |
| 15 | use embassy::io::{AsyncBufReadExt, AsyncWriteExt}; | 15 | use embassy::io::{AsyncBufReadExt, AsyncWriteExt}; |
| 16 | use embassy::time::{Duration, Timer}; | 16 | use embassy::time::{Duration, Timer}; |
| @@ -25,7 +25,7 @@ use stm32f4xx_hal::prelude::*; | |||
| 25 | use usb_device::bus::UsbBusAllocator; | 25 | use usb_device::bus::UsbBusAllocator; |
| 26 | use usb_device::prelude::*; | 26 | use usb_device::prelude::*; |
| 27 | 27 | ||
| 28 | #[task] | 28 | #[embassy::task] |
| 29 | async fn run1(bus: &'static mut UsbBusAllocator<UsbBus<USB>>) { | 29 | async fn run1(bus: &'static mut UsbBusAllocator<UsbBus<USB>>) { |
| 30 | info!("Async task"); | 30 | info!("Async task"); |
| 31 | 31 | ||
