diff options
| author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2022-08-17 20:27:42 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-08-17 20:27:42 +0000 |
| commit | 1c5b54a4823d596db730eb476c3ab78110557214 (patch) | |
| tree | 1d22c32eae26435677df89083d71f50fc298a09f /examples/nrf/src/bin/self_spawn_current_executor.rs | |
| parent | d881f3ad9186cf3279aa1ba27093bad94035c186 (diff) | |
| parent | 2e85eaf7d5f4dcf6d84f426542b8ec87aa51c429 (diff) | |
Merge #908
908: Remove HAL initialization from #[embassy_executor::main] macro. r=Dirbaio a=Dirbaio
Co-authored-by: Dario Nieuwenhuis <[email protected]>
Diffstat (limited to 'examples/nrf/src/bin/self_spawn_current_executor.rs')
| -rw-r--r-- | examples/nrf/src/bin/self_spawn_current_executor.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/nrf/src/bin/self_spawn_current_executor.rs b/examples/nrf/src/bin/self_spawn_current_executor.rs index 1d8309d77..11fe6fb40 100644 --- a/examples/nrf/src/bin/self_spawn_current_executor.rs +++ b/examples/nrf/src/bin/self_spawn_current_executor.rs | |||
| @@ -5,7 +5,6 @@ | |||
| 5 | use defmt::{info, unwrap}; | 5 | use defmt::{info, unwrap}; |
| 6 | use embassy_executor::executor::Spawner; | 6 | use embassy_executor::executor::Spawner; |
| 7 | use embassy_executor::time::{Duration, Timer}; | 7 | use embassy_executor::time::{Duration, Timer}; |
| 8 | use embassy_nrf::Peripherals; | ||
| 9 | use {defmt_rtt as _, panic_probe as _}; | 8 | use {defmt_rtt as _, panic_probe as _}; |
| 10 | 9 | ||
| 11 | #[embassy_executor::task(pool_size = 2)] | 10 | #[embassy_executor::task(pool_size = 2)] |
| @@ -16,7 +15,8 @@ async fn my_task(n: u32) { | |||
| 16 | } | 15 | } |
| 17 | 16 | ||
| 18 | #[embassy_executor::main] | 17 | #[embassy_executor::main] |
| 19 | async fn main(spawner: Spawner, _p: Peripherals) { | 18 | async fn main(spawner: Spawner) { |
| 19 | let _p = embassy_nrf::init(Default::default()); | ||
| 20 | info!("Hello World!"); | 20 | info!("Hello World!"); |
| 21 | unwrap!(spawner.spawn(my_task(0))); | 21 | unwrap!(spawner.spawn(my_task(0))); |
| 22 | } | 22 | } |
