aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2022-07-29 21:58:35 +0200
committerDario Nieuwenhuis <[email protected]>2022-07-29 23:40:36 +0200
commita0f1b0ee01d461607660d2d56b5b1bdc57e0d3fb (patch)
treee60fc8f8db8ec07e55d655c1a830b07f4db0b7d2 /examples
parent8745d646f0976791b7098456aa61adb983fb1c18 (diff)
Split embassy crate into embassy-executor, embassy-util.
Diffstat (limited to 'examples')
-rw-r--r--examples/boot/application/nrf/Cargo.toml3
-rw-r--r--examples/boot/application/nrf/src/bin/a.rs4
-rw-r--r--examples/boot/application/nrf/src/bin/b.rs6
-rw-r--r--examples/boot/application/stm32f3/Cargo.toml3
-rw-r--r--examples/boot/application/stm32f3/src/bin/a.rs4
-rw-r--r--examples/boot/application/stm32f3/src/bin/b.rs6
-rw-r--r--examples/boot/application/stm32f7/Cargo.toml3
-rw-r--r--examples/boot/application/stm32f7/src/bin/a.rs4
-rw-r--r--examples/boot/application/stm32f7/src/bin/b.rs6
-rw-r--r--examples/boot/application/stm32h7/Cargo.toml3
-rw-r--r--examples/boot/application/stm32h7/src/bin/a.rs4
-rw-r--r--examples/boot/application/stm32h7/src/bin/b.rs6
-rw-r--r--examples/boot/application/stm32l0/Cargo.toml3
-rw-r--r--examples/boot/application/stm32l0/src/bin/a.rs6
-rw-r--r--examples/boot/application/stm32l0/src/bin/b.rs6
-rw-r--r--examples/boot/application/stm32l1/Cargo.toml3
-rw-r--r--examples/boot/application/stm32l1/src/bin/a.rs6
-rw-r--r--examples/boot/application/stm32l1/src/bin/b.rs6
-rw-r--r--examples/boot/application/stm32l4/Cargo.toml3
-rw-r--r--examples/boot/application/stm32l4/src/bin/a.rs4
-rw-r--r--examples/boot/application/stm32l4/src/bin/b.rs6
-rw-r--r--examples/boot/application/stm32wl/Cargo.toml3
-rw-r--r--examples/boot/application/stm32wl/src/bin/a.rs4
-rw-r--r--examples/boot/application/stm32wl/src/bin/b.rs6
-rw-r--r--examples/boot/bootloader/nrf/Cargo.toml1
-rw-r--r--examples/boot/bootloader/stm32/Cargo.toml1
-rw-r--r--examples/nrf/Cargo.toml5
-rw-r--r--examples/nrf/src/bin/awaitable_timer.rs4
-rw-r--r--examples/nrf/src/bin/blinky.rs6
-rw-r--r--examples/nrf/src/bin/buffered_uart.rs4
-rw-r--r--examples/nrf/src/bin/channel.rs12
-rw-r--r--examples/nrf/src/bin/channel_sender_receiver.rs16
-rw-r--r--examples/nrf/src/bin/executor_fairness_test.rs12
-rw-r--r--examples/nrf/src/bin/gpiote_channel.rs4
-rw-r--r--examples/nrf/src/bin/gpiote_port.rs6
-rw-r--r--examples/nrf/src/bin/multiprio.rs10
-rw-r--r--examples/nrf/src/bin/mutex.rs12
-rw-r--r--examples/nrf/src/bin/nvmc.rs6
-rw-r--r--examples/nrf/src/bin/ppi.rs4
-rw-r--r--examples/nrf/src/bin/pubsub.rs16
-rw-r--r--examples/nrf/src/bin/pwm.rs6
-rw-r--r--examples/nrf/src/bin/pwm_double_sequence.rs6
-rw-r--r--examples/nrf/src/bin/pwm_sequence.rs6
-rw-r--r--examples/nrf/src/bin/pwm_sequence_ppi.rs4
-rw-r--r--examples/nrf/src/bin/pwm_sequence_ws2812b.rs6
-rw-r--r--examples/nrf/src/bin/pwm_servo.rs6
-rw-r--r--examples/nrf/src/bin/qdec.rs4
-rw-r--r--examples/nrf/src/bin/qspi.rs4
-rw-r--r--examples/nrf/src/bin/qspi_lowpower.rs6
-rw-r--r--examples/nrf/src/bin/raw_spawn.rs8
-rw-r--r--examples/nrf/src/bin/rng.rs4
-rw-r--r--examples/nrf/src/bin/saadc.rs6
-rw-r--r--examples/nrf/src/bin/saadc_continuous.rs8
-rw-r--r--examples/nrf/src/bin/self_spawn.rs8
-rw-r--r--examples/nrf/src/bin/self_spawn_current_executor.rs8
-rw-r--r--examples/nrf/src/bin/spim.rs4
-rw-r--r--examples/nrf/src/bin/temp.rs6
-rw-r--r--examples/nrf/src/bin/timer.rs10
-rw-r--r--examples/nrf/src/bin/twim.rs4
-rw-r--r--examples/nrf/src/bin/twim_lowpower.rs6
-rw-r--r--examples/nrf/src/bin/uart.rs4
-rw-r--r--examples/nrf/src/bin/uart_idle.rs4
-rw-r--r--examples/nrf/src/bin/uart_split.rs10
-rw-r--r--examples/nrf/src/bin/usb_ethernet.rs18
-rw-r--r--examples/nrf/src/bin/usb_hid_keyboard.rs13
-rw-r--r--examples/nrf/src/bin/usb_hid_mouse.rs10
-rw-r--r--examples/nrf/src/bin/usb_serial.rs4
-rw-r--r--examples/nrf/src/bin/usb_serial_multitask.rs10
-rw-r--r--examples/nrf/src/bin/wdt.rs4
-rw-r--r--examples/rp/Cargo.toml3
-rw-r--r--examples/rp/src/bin/blinky.rs6
-rw-r--r--examples/rp/src/bin/button.rs4
-rw-r--r--examples/rp/src/bin/gpio_async.rs6
-rw-r--r--examples/rp/src/bin/spi.rs4
-rw-r--r--examples/rp/src/bin/spi_display.rs6
-rw-r--r--examples/rp/src/bin/uart.rs4
-rw-r--r--examples/std/Cargo.toml3
-rw-r--r--examples/std/src/bin/net.rs8
-rw-r--r--examples/std/src/bin/serial.rs6
-rw-r--r--examples/std/src/bin/tick.rs8
-rw-r--r--examples/stm32f0/Cargo.toml3
-rw-r--r--examples/stm32f0/src/bin/hello.rs6
-rw-r--r--examples/stm32f1/Cargo.toml3
-rw-r--r--examples/stm32f1/src/bin/adc.rs6
-rw-r--r--examples/stm32f1/src/bin/blinky.rs6
-rw-r--r--examples/stm32f1/src/bin/hello.rs6
-rw-r--r--examples/stm32f1/src/bin/usb_serial.rs6
-rw-r--r--examples/stm32f2/Cargo.toml3
-rw-r--r--examples/stm32f2/src/bin/blinky.rs6
-rw-r--r--examples/stm32f2/src/bin/pll.rs6
-rw-r--r--examples/stm32f3/Cargo.toml3
-rw-r--r--examples/stm32f3/src/bin/blinky.rs6
-rw-r--r--examples/stm32f3/src/bin/button_events.rs14
-rw-r--r--examples/stm32f3/src/bin/button_exti.rs4
-rw-r--r--examples/stm32f3/src/bin/flash.rs4
-rw-r--r--examples/stm32f3/src/bin/hello.rs6
-rw-r--r--examples/stm32f3/src/bin/multiprio.rs10
-rw-r--r--examples/stm32f3/src/bin/spi_dma.rs4
-rw-r--r--examples/stm32f3/src/bin/usart_dma.rs4
-rw-r--r--examples/stm32f3/src/bin/usb_serial.rs6
-rw-r--r--examples/stm32f4/Cargo.toml3
-rw-r--r--examples/stm32f4/src/bin/adc.rs6
-rw-r--r--examples/stm32f4/src/bin/blinky.rs6
-rw-r--r--examples/stm32f4/src/bin/button_exti.rs4
-rw-r--r--examples/stm32f4/src/bin/flash.rs4
-rw-r--r--examples/stm32f4/src/bin/hello.rs6
-rw-r--r--examples/stm32f4/src/bin/multiprio.rs10
-rw-r--r--examples/stm32f4/src/bin/pwm.rs6
-rw-r--r--examples/stm32f4/src/bin/sdmmc.rs4
-rw-r--r--examples/stm32f4/src/bin/spi_dma.rs4
-rw-r--r--examples/stm32f4/src/bin/usart_buffered.rs4
-rw-r--r--examples/stm32f4/src/bin/usart_dma.rs4
-rw-r--r--examples/stm32f4/src/bin/wdt.rs6
-rw-r--r--examples/stm32f7/Cargo.toml3
-rw-r--r--examples/stm32f7/src/bin/adc.rs6
-rw-r--r--examples/stm32f7/src/bin/blinky.rs6
-rw-r--r--examples/stm32f7/src/bin/button_exti.rs4
-rw-r--r--examples/stm32f7/src/bin/eth.rs10
-rw-r--r--examples/stm32f7/src/bin/flash.rs6
-rw-r--r--examples/stm32f7/src/bin/hello.rs6
-rw-r--r--examples/stm32f7/src/bin/sdmmc.rs4
-rw-r--r--examples/stm32f7/src/bin/usart_dma.rs4
-rw-r--r--examples/stm32g0/Cargo.toml3
-rw-r--r--examples/stm32g0/src/bin/blinky.rs6
-rw-r--r--examples/stm32g0/src/bin/button_exti.rs4
-rw-r--r--examples/stm32g4/Cargo.toml3
-rw-r--r--examples/stm32g4/src/bin/blinky.rs6
-rw-r--r--examples/stm32g4/src/bin/button_exti.rs4
-rw-r--r--examples/stm32g4/src/bin/pwm.rs6
-rw-r--r--examples/stm32h7/Cargo.toml3
-rw-r--r--examples/stm32h7/src/bin/adc.rs6
-rw-r--r--examples/stm32h7/src/bin/blinky.rs6
-rw-r--r--examples/stm32h7/src/bin/button_exti.rs4
-rw-r--r--examples/stm32h7/src/bin/camera.rs8
-rw-r--r--examples/stm32h7/src/bin/eth.rs10
-rw-r--r--examples/stm32h7/src/bin/flash.rs6
-rw-r--r--examples/stm32h7/src/bin/fmc.rs6
-rw-r--r--examples/stm32h7/src/bin/low_level_timer_api.rs6
-rw-r--r--examples/stm32h7/src/bin/mco.rs6
-rw-r--r--examples/stm32h7/src/bin/pwm.rs6
-rw-r--r--examples/stm32h7/src/bin/rng.rs4
-rw-r--r--examples/stm32h7/src/bin/sdmmc.rs4
-rw-r--r--examples/stm32h7/src/bin/signal.rs10
-rw-r--r--examples/stm32h7/src/bin/spi.rs6
-rw-r--r--examples/stm32h7/src/bin/spi_dma.rs6
-rw-r--r--examples/stm32h7/src/bin/usart.rs6
-rw-r--r--examples/stm32h7/src/bin/usart_dma.rs6
-rw-r--r--examples/stm32h7/src/bin/usart_split.rs12
-rw-r--r--examples/stm32l0/Cargo.toml3
-rw-r--r--examples/stm32l0/src/bin/blinky.rs6
-rw-r--r--examples/stm32l0/src/bin/button.rs4
-rw-r--r--examples/stm32l0/src/bin/button_exti.rs4
-rw-r--r--examples/stm32l0/src/bin/flash.rs4
-rw-r--r--examples/stm32l0/src/bin/lorawan.rs4
-rw-r--r--examples/stm32l0/src/bin/raw_spawn.rs8
-rw-r--r--examples/stm32l0/src/bin/spi.rs4
-rw-r--r--examples/stm32l0/src/bin/usart_dma.rs4
-rw-r--r--examples/stm32l0/src/bin/usart_irq.rs4
-rw-r--r--examples/stm32l1/Cargo.toml3
-rw-r--r--examples/stm32l1/src/bin/blinky.rs6
-rw-r--r--examples/stm32l1/src/bin/flash.rs4
-rw-r--r--examples/stm32l1/src/bin/spi.rs4
-rw-r--r--examples/stm32l4/Cargo.toml3
-rw-r--r--examples/stm32l4/src/bin/adc.rs2
-rw-r--r--examples/stm32l4/src/bin/blinky.rs6
-rw-r--r--examples/stm32l4/src/bin/button_exti.rs4
-rw-r--r--examples/stm32l4/src/bin/i2c.rs4
-rw-r--r--examples/stm32l4/src/bin/i2c_blocking_async.rs4
-rw-r--r--examples/stm32l4/src/bin/i2c_dma.rs4
-rw-r--r--examples/stm32l4/src/bin/rng.rs4
-rw-r--r--examples/stm32l4/src/bin/spi_blocking_async.rs4
-rw-r--r--examples/stm32l4/src/bin/spi_dma.rs4
-rw-r--r--examples/stm32l4/src/bin/usart_dma.rs4
-rw-r--r--examples/stm32l5/Cargo.toml3
-rw-r--r--examples/stm32l5/src/bin/button_exti.rs4
-rw-r--r--examples/stm32l5/src/bin/rng.rs4
-rw-r--r--examples/stm32l5/src/bin/usb_ethernet.rs18
-rw-r--r--examples/stm32l5/src/bin/usb_hid_mouse.rs6
-rw-r--r--examples/stm32l5/src/bin/usb_serial.rs4
-rw-r--r--examples/stm32u5/Cargo.toml3
-rw-r--r--examples/stm32u5/src/bin/blinky.rs6
-rw-r--r--examples/stm32wb/Cargo.toml3
-rw-r--r--examples/stm32wb/src/bin/blinky.rs6
-rw-r--r--examples/stm32wb/src/bin/button_exti.rs4
-rw-r--r--examples/stm32wl/Cargo.toml3
-rw-r--r--examples/stm32wl/src/bin/blinky.rs6
-rw-r--r--examples/stm32wl/src/bin/button_exti.rs4
-rw-r--r--examples/stm32wl/src/bin/flash.rs4
-rw-r--r--examples/stm32wl/src/bin/lorawan.rs4
-rw-r--r--examples/stm32wl/src/bin/subghz.rs6
-rw-r--r--examples/wasm/Cargo.toml3
-rw-r--r--examples/wasm/src/lib.rs8
192 files changed, 546 insertions, 521 deletions
diff --git a/examples/boot/application/nrf/Cargo.toml b/examples/boot/application/nrf/Cargo.toml
index 0ae7163c3..dd9bcc093 100644
--- a/examples/boot/application/nrf/Cargo.toml
+++ b/examples/boot/application/nrf/Cargo.toml
@@ -4,7 +4,8 @@ name = "embassy-boot-nrf-examples"
4version = "0.1.0" 4version = "0.1.0"
5 5
6[dependencies] 6[dependencies]
7embassy = { version = "0.1.0", path = "../../../../embassy", features = ["nightly"] } 7embassy-util = { version = "0.1.0", path = "../../../../embassy-util" }
8embassy-executor = { version = "0.1.0", path = "../../../../embassy-executor", features = ["nightly"] }
8embassy-nrf = { version = "0.1.0", path = "../../../../embassy-nrf", features = ["time-driver-rtc1", "gpiote", "nightly", "nrf52840"] } 9embassy-nrf = { version = "0.1.0", path = "../../../../embassy-nrf", features = ["time-driver-rtc1", "gpiote", "nightly", "nrf52840"] }
9embassy-boot-nrf = { version = "0.1.0", path = "../../../../embassy-boot/nrf" } 10embassy-boot-nrf = { version = "0.1.0", path = "../../../../embassy-boot/nrf" }
10embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" } 11embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" }
diff --git a/examples/boot/application/nrf/src/bin/a.rs b/examples/boot/application/nrf/src/bin/a.rs
index 0b9715e49..3044645a8 100644
--- a/examples/boot/application/nrf/src/bin/a.rs
+++ b/examples/boot/application/nrf/src/bin/a.rs
@@ -13,8 +13,8 @@ use panic_reset as _;
13 13
14static APP_B: &[u8] = include_bytes!("../../b.bin"); 14static APP_B: &[u8] = include_bytes!("../../b.bin");
15 15
16#[embassy::main] 16#[embassy_executor::main]
17async fn main(_s: embassy::executor::Spawner, p: Peripherals) { 17async fn main(_s: embassy_executor::executor::Spawner, p: Peripherals) {
18 let mut button = Input::new(p.P0_11, Pull::Up); 18 let mut button = Input::new(p.P0_11, Pull::Up);
19 let mut led = Output::new(p.P0_13, Level::Low, OutputDrive::Standard); 19 let mut led = Output::new(p.P0_13, Level::Low, OutputDrive::Standard);
20 //let mut led = Output::new(p.P1_10, Level::Low, OutputDrive::Standard); 20 //let mut led = Output::new(p.P1_10, Level::Low, OutputDrive::Standard);
diff --git a/examples/boot/application/nrf/src/bin/b.rs b/examples/boot/application/nrf/src/bin/b.rs
index a06c20f8b..2f76d20c6 100644
--- a/examples/boot/application/nrf/src/bin/b.rs
+++ b/examples/boot/application/nrf/src/bin/b.rs
@@ -4,13 +4,13 @@
4#![feature(generic_associated_types)] 4#![feature(generic_associated_types)]
5#![feature(type_alias_impl_trait)] 5#![feature(type_alias_impl_trait)]
6 6
7use embassy::time::{Duration, Timer}; 7use embassy_executor::time::{Duration, Timer};
8use embassy_nrf::gpio::{Level, Output, OutputDrive}; 8use embassy_nrf::gpio::{Level, Output, OutputDrive};
9use embassy_nrf::Peripherals; 9use embassy_nrf::Peripherals;
10use panic_reset as _; 10use panic_reset as _;
11 11
12#[embassy::main] 12#[embassy_executor::main]
13async fn main(_s: embassy::executor::Spawner, p: Peripherals) { 13async fn main(_s: embassy_executor::executor::Spawner, p: Peripherals) {
14 let mut led = Output::new(p.P0_13, Level::Low, OutputDrive::Standard); 14 let mut led = Output::new(p.P0_13, Level::Low, OutputDrive::Standard);
15 //let mut led = Output::new(p.P1_10, Level::Low, OutputDrive::Standard); 15 //let mut led = Output::new(p.P1_10, Level::Low, OutputDrive::Standard);
16 16
diff --git a/examples/boot/application/stm32f3/Cargo.toml b/examples/boot/application/stm32f3/Cargo.toml
index 36fc135fe..313808a0d 100644
--- a/examples/boot/application/stm32f3/Cargo.toml
+++ b/examples/boot/application/stm32f3/Cargo.toml
@@ -4,7 +4,8 @@ name = "embassy-boot-stm32f3-examples"
4version = "0.1.0" 4version = "0.1.0"
5 5
6[dependencies] 6[dependencies]
7embassy = { version = "0.1.0", path = "../../../../embassy", features = ["nightly", "time-tick-32768hz"] } 7embassy-util = { version = "0.1.0", path = "../../../../embassy-util", features = ["defmt"] }
8embassy-executor = { version = "0.1.0", path = "../../../../embassy-executor", features = ["nightly", "time-tick-32768hz"] }
8embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32f303re", "time-driver-any", "exti"] } 9embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32f303re", "time-driver-any", "exti"] }
9embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32" } 10embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32" }
10embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" } 11embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" }
diff --git a/examples/boot/application/stm32f3/src/bin/a.rs b/examples/boot/application/stm32f3/src/bin/a.rs
index 4ff18d7c7..fd18e9373 100644
--- a/examples/boot/application/stm32f3/src/bin/a.rs
+++ b/examples/boot/application/stm32f3/src/bin/a.rs
@@ -14,8 +14,8 @@ use panic_reset as _;
14 14
15static APP_B: &[u8] = include_bytes!("../../b.bin"); 15static APP_B: &[u8] = include_bytes!("../../b.bin");
16 16
17#[embassy::main] 17#[embassy_executor::main]
18async fn main(_s: embassy::executor::Spawner, p: Peripherals) { 18async fn main(_s: embassy_executor::executor::Spawner, p: Peripherals) {
19 let flash = Flash::unlock(p.FLASH); 19 let flash = Flash::unlock(p.FLASH);
20 let mut flash = BlockingAsync::new(flash); 20 let mut flash = BlockingAsync::new(flash);
21 21
diff --git a/examples/boot/application/stm32f3/src/bin/b.rs b/examples/boot/application/stm32f3/src/bin/b.rs
index 4487e586e..934f862d9 100644
--- a/examples/boot/application/stm32f3/src/bin/b.rs
+++ b/examples/boot/application/stm32f3/src/bin/b.rs
@@ -4,13 +4,13 @@
4 4
5#[cfg(feature = "defmt-rtt")] 5#[cfg(feature = "defmt-rtt")]
6use defmt_rtt::*; 6use defmt_rtt::*;
7use embassy::executor::Spawner; 7use embassy_executor::executor::Spawner;
8use embassy::time::{Duration, Timer}; 8use embassy_executor::time::{Duration, Timer};
9use embassy_stm32::gpio::{Level, Output, Speed}; 9use embassy_stm32::gpio::{Level, Output, Speed};
10use embassy_stm32::Peripherals; 10use embassy_stm32::Peripherals;
11use panic_reset as _; 11use panic_reset as _;
12 12
13#[embassy::main] 13#[embassy_executor::main]
14async fn main(_spawner: Spawner, p: Peripherals) { 14async fn main(_spawner: Spawner, p: Peripherals) {
15 let mut led = Output::new(p.PA5, Level::High, Speed::Low); 15 let mut led = Output::new(p.PA5, Level::High, Speed::Low);
16 16
diff --git a/examples/boot/application/stm32f7/Cargo.toml b/examples/boot/application/stm32f7/Cargo.toml
index ad4a6fa76..2a4741dc7 100644
--- a/examples/boot/application/stm32f7/Cargo.toml
+++ b/examples/boot/application/stm32f7/Cargo.toml
@@ -4,7 +4,8 @@ name = "embassy-boot-stm32f7-examples"
4version = "0.1.0" 4version = "0.1.0"
5 5
6[dependencies] 6[dependencies]
7embassy = { version = "0.1.0", path = "../../../../embassy", features = ["nightly", "time-tick-32768hz"] } 7embassy-util = { version = "0.1.0", path = "../../../../embassy-util", features = ["defmt"] }
8embassy-executor = { version = "0.1.0", path = "../../../../embassy-executor", features = ["nightly", "time-tick-32768hz"] }
8embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32f767zi", "time-driver-any", "exti"] } 9embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32f767zi", "time-driver-any", "exti"] }
9embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32" } 10embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32" }
10embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" } 11embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" }
diff --git a/examples/boot/application/stm32f7/src/bin/a.rs b/examples/boot/application/stm32f7/src/bin/a.rs
index 9c7921a1a..10d709cfd 100644
--- a/examples/boot/application/stm32f7/src/bin/a.rs
+++ b/examples/boot/application/stm32f7/src/bin/a.rs
@@ -14,8 +14,8 @@ use panic_reset as _;
14 14
15static APP_B: &[u8] = include_bytes!("../../b.bin"); 15static APP_B: &[u8] = include_bytes!("../../b.bin");
16 16
17#[embassy::main] 17#[embassy_executor::main]
18async fn main(_s: embassy::executor::Spawner, p: Peripherals) { 18async fn main(_s: embassy_executor::executor::Spawner, p: Peripherals) {
19 let flash = Flash::unlock(p.FLASH); 19 let flash = Flash::unlock(p.FLASH);
20 let mut flash = BlockingAsync::new(flash); 20 let mut flash = BlockingAsync::new(flash);
21 21
diff --git a/examples/boot/application/stm32f7/src/bin/b.rs b/examples/boot/application/stm32f7/src/bin/b.rs
index aa05bbcdd..c89e8a310 100644
--- a/examples/boot/application/stm32f7/src/bin/b.rs
+++ b/examples/boot/application/stm32f7/src/bin/b.rs
@@ -4,13 +4,13 @@
4 4
5#[cfg(feature = "defmt-rtt")] 5#[cfg(feature = "defmt-rtt")]
6use defmt_rtt::*; 6use defmt_rtt::*;
7use embassy::executor::Spawner; 7use embassy_executor::executor::Spawner;
8use embassy::time::{Duration, Timer}; 8use embassy_executor::time::{Duration, Timer};
9use embassy_stm32::gpio::{Level, Output, Speed}; 9use embassy_stm32::gpio::{Level, Output, Speed};
10use embassy_stm32::Peripherals; 10use embassy_stm32::Peripherals;
11use panic_reset as _; 11use panic_reset as _;
12 12
13#[embassy::main] 13#[embassy_executor::main]
14async fn main(_spawner: Spawner, p: Peripherals) { 14async fn main(_spawner: Spawner, p: Peripherals) {
15 Timer::after(Duration::from_millis(300)).await; 15 Timer::after(Duration::from_millis(300)).await;
16 let mut led = Output::new(p.PB7, Level::High, Speed::Low); 16 let mut led = Output::new(p.PB7, Level::High, Speed::Low);
diff --git a/examples/boot/application/stm32h7/Cargo.toml b/examples/boot/application/stm32h7/Cargo.toml
index 5dff770a8..c6420e8ad 100644
--- a/examples/boot/application/stm32h7/Cargo.toml
+++ b/examples/boot/application/stm32h7/Cargo.toml
@@ -4,7 +4,8 @@ name = "embassy-boot-stm32h7-examples"
4version = "0.1.0" 4version = "0.1.0"
5 5
6[dependencies] 6[dependencies]
7embassy = { version = "0.1.0", path = "../../../../embassy", features = ["nightly", "time-tick-32768hz"] } 7embassy-util = { version = "0.1.0", path = "../../../../embassy-util", features = ["defmt"] }
8embassy-executor = { version = "0.1.0", path = "../../../../embassy-executor", features = ["nightly", "time-tick-32768hz"] }
8embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32h743zi", "time-driver-any", "exti"] } 9embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32h743zi", "time-driver-any", "exti"] }
9embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32" } 10embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32" }
10embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" } 11embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" }
diff --git a/examples/boot/application/stm32h7/src/bin/a.rs b/examples/boot/application/stm32h7/src/bin/a.rs
index 704979dba..cc363bb32 100644
--- a/examples/boot/application/stm32h7/src/bin/a.rs
+++ b/examples/boot/application/stm32h7/src/bin/a.rs
@@ -14,8 +14,8 @@ use panic_reset as _;
14 14
15static APP_B: &[u8] = include_bytes!("../../b.bin"); 15static APP_B: &[u8] = include_bytes!("../../b.bin");
16 16
17#[embassy::main] 17#[embassy_executor::main]
18async fn main(_s: embassy::executor::Spawner, p: Peripherals) { 18async fn main(_s: embassy_executor::executor::Spawner, p: Peripherals) {
19 let flash = Flash::unlock(p.FLASH); 19 let flash = Flash::unlock(p.FLASH);
20 let mut flash = BlockingAsync::new(flash); 20 let mut flash = BlockingAsync::new(flash);
21 21
diff --git a/examples/boot/application/stm32h7/src/bin/b.rs b/examples/boot/application/stm32h7/src/bin/b.rs
index ea0140253..3fa63bdcf 100644
--- a/examples/boot/application/stm32h7/src/bin/b.rs
+++ b/examples/boot/application/stm32h7/src/bin/b.rs
@@ -4,13 +4,13 @@
4 4
5#[cfg(feature = "defmt-rtt")] 5#[cfg(feature = "defmt-rtt")]
6use defmt_rtt::*; 6use defmt_rtt::*;
7use embassy::executor::Spawner; 7use embassy_executor::executor::Spawner;
8use embassy::time::{Duration, Timer}; 8use embassy_executor::time::{Duration, Timer};
9use embassy_stm32::gpio::{Level, Output, Speed}; 9use embassy_stm32::gpio::{Level, Output, Speed};
10use embassy_stm32::Peripherals; 10use embassy_stm32::Peripherals;
11use panic_reset as _; 11use panic_reset as _;
12 12
13#[embassy::main] 13#[embassy_executor::main]
14async fn main(_spawner: Spawner, p: Peripherals) { 14async fn main(_spawner: Spawner, p: Peripherals) {
15 Timer::after(Duration::from_millis(300)).await; 15 Timer::after(Duration::from_millis(300)).await;
16 let mut led = Output::new(p.PB14, Level::High, Speed::Low); 16 let mut led = Output::new(p.PB14, Level::High, Speed::Low);
diff --git a/examples/boot/application/stm32l0/Cargo.toml b/examples/boot/application/stm32l0/Cargo.toml
index de7bea47b..a6936419c 100644
--- a/examples/boot/application/stm32l0/Cargo.toml
+++ b/examples/boot/application/stm32l0/Cargo.toml
@@ -4,7 +4,8 @@ name = "embassy-boot-stm32l0-examples"
4version = "0.1.0" 4version = "0.1.0"
5 5
6[dependencies] 6[dependencies]
7embassy = { version = "0.1.0", path = "../../../../embassy", features = ["nightly", "time-tick-32768hz"] } 7embassy-util = { version = "0.1.0", path = "../../../../embassy-util", features = ["defmt"] }
8embassy-executor = { version = "0.1.0", path = "../../../../embassy-executor", features = ["nightly", "time-tick-32768hz"] }
8embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32l072cz", "time-driver-any", "exti", "memory-x"] } 9embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32l072cz", "time-driver-any", "exti", "memory-x"] }
9embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32" } 10embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32" }
10embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" } 11embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" }
diff --git a/examples/boot/application/stm32l0/src/bin/a.rs b/examples/boot/application/stm32l0/src/bin/a.rs
index ce620347b..fcf3f2ef1 100644
--- a/examples/boot/application/stm32l0/src/bin/a.rs
+++ b/examples/boot/application/stm32l0/src/bin/a.rs
@@ -4,9 +4,9 @@
4 4
5#[cfg(feature = "defmt-rtt")] 5#[cfg(feature = "defmt-rtt")]
6use defmt_rtt::*; 6use defmt_rtt::*;
7use embassy::time::{Duration, Timer};
8use embassy_boot_stm32::FirmwareUpdater; 7use embassy_boot_stm32::FirmwareUpdater;
9use embassy_embedded_hal::adapter::BlockingAsync; 8use embassy_embedded_hal::adapter::BlockingAsync;
9use embassy_executor::time::{Duration, Timer};
10use embassy_stm32::exti::ExtiInput; 10use embassy_stm32::exti::ExtiInput;
11use embassy_stm32::flash::Flash; 11use embassy_stm32::flash::Flash;
12use embassy_stm32::gpio::{Input, Level, Output, Pull, Speed}; 12use embassy_stm32::gpio::{Input, Level, Output, Pull, Speed};
@@ -15,8 +15,8 @@ use panic_reset as _;
15 15
16static APP_B: &[u8] = include_bytes!("../../b.bin"); 16static APP_B: &[u8] = include_bytes!("../../b.bin");
17 17
18#[embassy::main] 18#[embassy_executor::main]
19async fn main(_s: embassy::executor::Spawner, p: Peripherals) { 19async fn main(_s: embassy_executor::executor::Spawner, p: Peripherals) {
20 let flash = Flash::unlock(p.FLASH); 20 let flash = Flash::unlock(p.FLASH);
21 let mut flash = BlockingAsync::new(flash); 21 let mut flash = BlockingAsync::new(flash);
22 22
diff --git a/examples/boot/application/stm32l0/src/bin/b.rs b/examples/boot/application/stm32l0/src/bin/b.rs
index 0b585a14c..46e394c4c 100644
--- a/examples/boot/application/stm32l0/src/bin/b.rs
+++ b/examples/boot/application/stm32l0/src/bin/b.rs
@@ -4,13 +4,13 @@
4 4
5#[cfg(feature = "defmt-rtt")] 5#[cfg(feature = "defmt-rtt")]
6use defmt_rtt::*; 6use defmt_rtt::*;
7use embassy::executor::Spawner; 7use embassy_executor::executor::Spawner;
8use embassy::time::{Duration, Timer}; 8use embassy_executor::time::{Duration, Timer};
9use embassy_stm32::gpio::{Level, Output, Speed}; 9use embassy_stm32::gpio::{Level, Output, Speed};
10use embassy_stm32::Peripherals; 10use embassy_stm32::Peripherals;
11use panic_reset as _; 11use panic_reset as _;
12 12
13#[embassy::main] 13#[embassy_executor::main]
14async fn main(_spawner: Spawner, p: Peripherals) { 14async fn main(_spawner: Spawner, p: Peripherals) {
15 let mut led = Output::new(p.PB6, Level::High, Speed::Low); 15 let mut led = Output::new(p.PB6, Level::High, Speed::Low);
16 16
diff --git a/examples/boot/application/stm32l1/Cargo.toml b/examples/boot/application/stm32l1/Cargo.toml
index 3fd6f639a..5e53cd5f6 100644
--- a/examples/boot/application/stm32l1/Cargo.toml
+++ b/examples/boot/application/stm32l1/Cargo.toml
@@ -4,7 +4,8 @@ name = "embassy-boot-stm32l1-examples"
4version = "0.1.0" 4version = "0.1.0"
5 5
6[dependencies] 6[dependencies]
7embassy = { version = "0.1.0", path = "../../../../embassy", features = ["nightly", "time-tick-32768hz"] } 7embassy-util = { version = "0.1.0", path = "../../../../embassy-util", features = ["defmt"] }
8embassy-executor = { version = "0.1.0", path = "../../../../embassy-executor", features = ["nightly", "time-tick-32768hz"] }
8embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32l151cb-a", "time-driver-any", "exti"] } 9embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32l151cb-a", "time-driver-any", "exti"] }
9embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32" } 10embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32" }
10embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" } 11embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" }
diff --git a/examples/boot/application/stm32l1/src/bin/a.rs b/examples/boot/application/stm32l1/src/bin/a.rs
index ce620347b..fcf3f2ef1 100644
--- a/examples/boot/application/stm32l1/src/bin/a.rs
+++ b/examples/boot/application/stm32l1/src/bin/a.rs
@@ -4,9 +4,9 @@
4 4
5#[cfg(feature = "defmt-rtt")] 5#[cfg(feature = "defmt-rtt")]
6use defmt_rtt::*; 6use defmt_rtt::*;
7use embassy::time::{Duration, Timer};
8use embassy_boot_stm32::FirmwareUpdater; 7use embassy_boot_stm32::FirmwareUpdater;
9use embassy_embedded_hal::adapter::BlockingAsync; 8use embassy_embedded_hal::adapter::BlockingAsync;
9use embassy_executor::time::{Duration, Timer};
10use embassy_stm32::exti::ExtiInput; 10use embassy_stm32::exti::ExtiInput;
11use embassy_stm32::flash::Flash; 11use embassy_stm32::flash::Flash;
12use embassy_stm32::gpio::{Input, Level, Output, Pull, Speed}; 12use embassy_stm32::gpio::{Input, Level, Output, Pull, Speed};
@@ -15,8 +15,8 @@ use panic_reset as _;
15 15
16static APP_B: &[u8] = include_bytes!("../../b.bin"); 16static APP_B: &[u8] = include_bytes!("../../b.bin");
17 17
18#[embassy::main] 18#[embassy_executor::main]
19async fn main(_s: embassy::executor::Spawner, p: Peripherals) { 19async fn main(_s: embassy_executor::executor::Spawner, p: Peripherals) {
20 let flash = Flash::unlock(p.FLASH); 20 let flash = Flash::unlock(p.FLASH);
21 let mut flash = BlockingAsync::new(flash); 21 let mut flash = BlockingAsync::new(flash);
22 22
diff --git a/examples/boot/application/stm32l1/src/bin/b.rs b/examples/boot/application/stm32l1/src/bin/b.rs
index 0b585a14c..46e394c4c 100644
--- a/examples/boot/application/stm32l1/src/bin/b.rs
+++ b/examples/boot/application/stm32l1/src/bin/b.rs
@@ -4,13 +4,13 @@
4 4
5#[cfg(feature = "defmt-rtt")] 5#[cfg(feature = "defmt-rtt")]
6use defmt_rtt::*; 6use defmt_rtt::*;
7use embassy::executor::Spawner; 7use embassy_executor::executor::Spawner;
8use embassy::time::{Duration, Timer}; 8use embassy_executor::time::{Duration, Timer};
9use embassy_stm32::gpio::{Level, Output, Speed}; 9use embassy_stm32::gpio::{Level, Output, Speed};
10use embassy_stm32::Peripherals; 10use embassy_stm32::Peripherals;
11use panic_reset as _; 11use panic_reset as _;
12 12
13#[embassy::main] 13#[embassy_executor::main]
14async fn main(_spawner: Spawner, p: Peripherals) { 14async fn main(_spawner: Spawner, p: Peripherals) {
15 let mut led = Output::new(p.PB6, Level::High, Speed::Low); 15 let mut led = Output::new(p.PB6, Level::High, Speed::Low);
16 16
diff --git a/examples/boot/application/stm32l4/Cargo.toml b/examples/boot/application/stm32l4/Cargo.toml
index 7284af662..bbb5e7e1d 100644
--- a/examples/boot/application/stm32l4/Cargo.toml
+++ b/examples/boot/application/stm32l4/Cargo.toml
@@ -4,7 +4,8 @@ name = "embassy-boot-stm32l4-examples"
4version = "0.1.0" 4version = "0.1.0"
5 5
6[dependencies] 6[dependencies]
7embassy = { version = "0.1.0", path = "../../../../embassy", features = ["nightly", "time-tick-32768hz"] } 7embassy-util = { version = "0.1.0", path = "../../../../embassy-util", features = ["defmt"] }
8embassy-executor = { version = "0.1.0", path = "../../../../embassy-executor", features = ["nightly", "time-tick-32768hz"] }
8embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32l475vg", "time-driver-any", "exti"] } 9embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32l475vg", "time-driver-any", "exti"] }
9embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32" } 10embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32" }
10embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" } 11embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" }
diff --git a/examples/boot/application/stm32l4/src/bin/a.rs b/examples/boot/application/stm32l4/src/bin/a.rs
index bf6099355..f092f0239 100644
--- a/examples/boot/application/stm32l4/src/bin/a.rs
+++ b/examples/boot/application/stm32l4/src/bin/a.rs
@@ -14,8 +14,8 @@ use panic_reset as _;
14 14
15static APP_B: &[u8] = include_bytes!("../../b.bin"); 15static APP_B: &[u8] = include_bytes!("../../b.bin");
16 16
17#[embassy::main] 17#[embassy_executor::main]
18async fn main(_s: embassy::executor::Spawner, p: Peripherals) { 18async fn main(_s: embassy_executor::executor::Spawner, p: Peripherals) {
19 let flash = Flash::unlock(p.FLASH); 19 let flash = Flash::unlock(p.FLASH);
20 let mut flash = BlockingAsync::new(flash); 20 let mut flash = BlockingAsync::new(flash);
21 21
diff --git a/examples/boot/application/stm32l4/src/bin/b.rs b/examples/boot/application/stm32l4/src/bin/b.rs
index 4487e586e..934f862d9 100644
--- a/examples/boot/application/stm32l4/src/bin/b.rs
+++ b/examples/boot/application/stm32l4/src/bin/b.rs
@@ -4,13 +4,13 @@
4 4
5#[cfg(feature = "defmt-rtt")] 5#[cfg(feature = "defmt-rtt")]
6use defmt_rtt::*; 6use defmt_rtt::*;
7use embassy::executor::Spawner; 7use embassy_executor::executor::Spawner;
8use embassy::time::{Duration, Timer}; 8use embassy_executor::time::{Duration, Timer};
9use embassy_stm32::gpio::{Level, Output, Speed}; 9use embassy_stm32::gpio::{Level, Output, Speed};
10use embassy_stm32::Peripherals; 10use embassy_stm32::Peripherals;
11use panic_reset as _; 11use panic_reset as _;
12 12
13#[embassy::main] 13#[embassy_executor::main]
14async fn main(_spawner: Spawner, p: Peripherals) { 14async fn main(_spawner: Spawner, p: Peripherals) {
15 let mut led = Output::new(p.PA5, Level::High, Speed::Low); 15 let mut led = Output::new(p.PA5, Level::High, Speed::Low);
16 16
diff --git a/examples/boot/application/stm32wl/Cargo.toml b/examples/boot/application/stm32wl/Cargo.toml
index ca22e6134..62123a870 100644
--- a/examples/boot/application/stm32wl/Cargo.toml
+++ b/examples/boot/application/stm32wl/Cargo.toml
@@ -4,7 +4,8 @@ name = "embassy-boot-stm32wl-examples"
4version = "0.1.0" 4version = "0.1.0"
5 5
6[dependencies] 6[dependencies]
7embassy = { version = "0.1.0", path = "../../../../embassy", features = ["nightly", "time-tick-32768hz"] } 7embassy-util = { version = "0.1.0", path = "../../../../embassy-util", features = ["defmt"] }
8embassy-executor = { version = "0.1.0", path = "../../../../embassy-executor", features = ["nightly", "time-tick-32768hz"] }
8embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32wl55jc-cm4", "time-driver-any", "exti"] } 9embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32wl55jc-cm4", "time-driver-any", "exti"] }
9embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32" } 10embassy-boot-stm32 = { version = "0.1.0", path = "../../../../embassy-boot/stm32" }
10embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" } 11embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" }
diff --git a/examples/boot/application/stm32wl/src/bin/a.rs b/examples/boot/application/stm32wl/src/bin/a.rs
index dc1eb9bed..14408a90a 100644
--- a/examples/boot/application/stm32wl/src/bin/a.rs
+++ b/examples/boot/application/stm32wl/src/bin/a.rs
@@ -14,8 +14,8 @@ use panic_reset as _;
14 14
15static APP_B: &[u8] = include_bytes!("../../b.bin"); 15static APP_B: &[u8] = include_bytes!("../../b.bin");
16 16
17#[embassy::main] 17#[embassy_executor::main]
18async fn main(_s: embassy::executor::Spawner, p: Peripherals) { 18async fn main(_s: embassy_executor::executor::Spawner, p: Peripherals) {
19 let flash = Flash::unlock(p.FLASH); 19 let flash = Flash::unlock(p.FLASH);
20 let mut flash = BlockingAsync::new(flash); 20 let mut flash = BlockingAsync::new(flash);
21 21
diff --git a/examples/boot/application/stm32wl/src/bin/b.rs b/examples/boot/application/stm32wl/src/bin/b.rs
index f2344bd53..e565fd7c6 100644
--- a/examples/boot/application/stm32wl/src/bin/b.rs
+++ b/examples/boot/application/stm32wl/src/bin/b.rs
@@ -4,13 +4,13 @@
4 4
5#[cfg(feature = "defmt-rtt")] 5#[cfg(feature = "defmt-rtt")]
6use defmt_rtt::*; 6use defmt_rtt::*;
7use embassy::executor::Spawner; 7use embassy_executor::executor::Spawner;
8use embassy::time::{Duration, Timer}; 8use embassy_executor::time::{Duration, Timer};
9use embassy_stm32::gpio::{Level, Output, Speed}; 9use embassy_stm32::gpio::{Level, Output, Speed};
10use embassy_stm32::Peripherals; 10use embassy_stm32::Peripherals;
11use panic_reset as _; 11use panic_reset as _;
12 12
13#[embassy::main] 13#[embassy_executor::main]
14async fn main(_spawner: Spawner, p: Peripherals) { 14async fn main(_spawner: Spawner, p: Peripherals) {
15 let mut led = Output::new(p.PB15, Level::High, Speed::Low); 15 let mut led = Output::new(p.PB15, Level::High, Speed::Low);
16 16
diff --git a/examples/boot/bootloader/nrf/Cargo.toml b/examples/boot/bootloader/nrf/Cargo.toml
index 8eb98623c..9683bff19 100644
--- a/examples/boot/bootloader/nrf/Cargo.toml
+++ b/examples/boot/bootloader/nrf/Cargo.toml
@@ -8,7 +8,6 @@ description = "Bootloader for nRF chips"
8defmt = { version = "0.3", optional = true } 8defmt = { version = "0.3", optional = true }
9defmt-rtt = { version = "0.3", optional = true } 9defmt-rtt = { version = "0.3", optional = true }
10 10
11embassy = { path = "../../../../embassy", default-features = false }
12embassy-nrf = { path = "../../../../embassy-nrf", default-features = false, features = ["nightly"] } 11embassy-nrf = { path = "../../../../embassy-nrf", default-features = false, features = ["nightly"] }
13embassy-boot-nrf = { path = "../../../../embassy-boot/nrf", default-features = false } 12embassy-boot-nrf = { path = "../../../../embassy-boot/nrf", default-features = false }
14cortex-m = { version = "0.7" } 13cortex-m = { version = "0.7" }
diff --git a/examples/boot/bootloader/stm32/Cargo.toml b/examples/boot/bootloader/stm32/Cargo.toml
index b99a8fbcd..4a3319528 100644
--- a/examples/boot/bootloader/stm32/Cargo.toml
+++ b/examples/boot/bootloader/stm32/Cargo.toml
@@ -8,7 +8,6 @@ description = "Example bootloader for STM32 chips"
8defmt = { version = "0.3", optional = true } 8defmt = { version = "0.3", optional = true }
9defmt-rtt = { version = "0.3", optional = true } 9defmt-rtt = { version = "0.3", optional = true }
10 10
11embassy = { path = "../../../../embassy", default-features = false }
12embassy-stm32 = { path = "../../../../embassy-stm32", default-features = false, features = ["nightly"] } 11embassy-stm32 = { path = "../../../../embassy-stm32", default-features = false, features = ["nightly"] }
13embassy-boot-stm32 = { path = "../../../../embassy-boot/stm32", default-features = false } 12embassy-boot-stm32 = { path = "../../../../embassy-boot/stm32", default-features = false }
14cortex-m = { version = "0.7" } 13cortex-m = { version = "0.7" }
diff --git a/examples/nrf/Cargo.toml b/examples/nrf/Cargo.toml
index 0cba77694..91edbd36d 100644
--- a/examples/nrf/Cargo.toml
+++ b/examples/nrf/Cargo.toml
@@ -5,10 +5,11 @@ version = "0.1.0"
5 5
6[features] 6[features]
7default = ["nightly"] 7default = ["nightly"]
8nightly = ["embassy-nrf/nightly", "embassy-nrf/unstable-traits", "embassy-usb", "embassy-usb-serial", "embassy-usb-hid", "embassy-usb-ncm", "embedded-io/async", "embassy-net"] 8nightly = ["embassy-executor/nightly", "embassy-nrf/nightly", "embassy-nrf/unstable-traits", "embassy-usb", "embassy-usb-serial", "embassy-usb-hid", "embassy-usb-ncm", "embedded-io/async", "embassy-net"]
9 9
10[dependencies] 10[dependencies]
11embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt", "defmt-timestamp-uptime"] } 11embassy-util = { version = "0.1.0", path = "../../embassy-util", features = ["defmt"] }
12embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "defmt-timestamp-uptime"] }
12embassy-nrf = { version = "0.1.0", path = "../../embassy-nrf", features = ["defmt", "nrf52840", "time-driver-rtc1", "gpiote", "unstable-pac"] } 13embassy-nrf = { version = "0.1.0", path = "../../embassy-nrf", features = ["defmt", "nrf52840", "time-driver-rtc1", "gpiote", "unstable-pac"] }
13embassy-net = { version = "0.1.0", path = "../../embassy-net", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet", "pool-16"], optional = true } 14embassy-net = { version = "0.1.0", path = "../../embassy-net", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet", "pool-16"], optional = true }
14embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"], optional = true } 15embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"], optional = true }
diff --git a/examples/nrf/src/bin/awaitable_timer.rs b/examples/nrf/src/bin/awaitable_timer.rs
index 34a657cb9..f2c1d9fa4 100644
--- a/examples/nrf/src/bin/awaitable_timer.rs
+++ b/examples/nrf/src/bin/awaitable_timer.rs
@@ -3,12 +3,12 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::info; 5use defmt::info;
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy_nrf::timer::Timer; 7use embassy_nrf::timer::Timer;
8use embassy_nrf::{interrupt, Peripherals}; 8use embassy_nrf::{interrupt, Peripherals};
9use {defmt_rtt as _, panic_probe as _}; 9use {defmt_rtt as _, panic_probe as _};
10 10
11#[embassy::main] 11#[embassy_executor::main]
12async fn main(_spawner: Spawner, p: Peripherals) { 12async fn main(_spawner: Spawner, p: Peripherals) {
13 let mut t = Timer::new_awaitable(p.TIMER0, interrupt::take!(TIMER0)); 13 let mut t = Timer::new_awaitable(p.TIMER0, interrupt::take!(TIMER0));
14 // default frequency is 1MHz, so this triggers every second 14 // default frequency is 1MHz, so this triggers every second
diff --git a/examples/nrf/src/bin/blinky.rs b/examples/nrf/src/bin/blinky.rs
index 23d16f796..98db6546c 100644
--- a/examples/nrf/src/bin/blinky.rs
+++ b/examples/nrf/src/bin/blinky.rs
@@ -2,13 +2,13 @@
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use embassy::executor::Spawner; 5use embassy_executor::executor::Spawner;
6use embassy::time::{Duration, Timer}; 6use embassy_executor::time::{Duration, Timer};
7use embassy_nrf::gpio::{Level, Output, OutputDrive}; 7use embassy_nrf::gpio::{Level, Output, OutputDrive};
8use embassy_nrf::Peripherals; 8use embassy_nrf::Peripherals;
9use {defmt_rtt as _, panic_probe as _}; 9use {defmt_rtt as _, panic_probe as _};
10 10
11#[embassy::main] 11#[embassy_executor::main]
12async fn main(_spawner: Spawner, p: Peripherals) { 12async fn main(_spawner: Spawner, p: Peripherals) {
13 let mut led = Output::new(p.P0_13, Level::Low, OutputDrive::Standard); 13 let mut led = Output::new(p.P0_13, Level::Low, OutputDrive::Standard);
14 14
diff --git a/examples/nrf/src/bin/buffered_uart.rs b/examples/nrf/src/bin/buffered_uart.rs
index 18dd698bf..f02b7d845 100644
--- a/examples/nrf/src/bin/buffered_uart.rs
+++ b/examples/nrf/src/bin/buffered_uart.rs
@@ -3,14 +3,14 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::*; 5use defmt::*;
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy_nrf::buffered_uarte::{BufferedUarte, State}; 7use embassy_nrf::buffered_uarte::{BufferedUarte, State};
8use embassy_nrf::{interrupt, uarte, Peripherals}; 8use embassy_nrf::{interrupt, uarte, Peripherals};
9use embedded_io::asynch::{BufRead, Write}; 9use embedded_io::asynch::{BufRead, Write};
10use futures::pin_mut; 10use futures::pin_mut;
11use {defmt_rtt as _, panic_probe as _}; 11use {defmt_rtt as _, panic_probe as _};
12 12
13#[embassy::main] 13#[embassy_executor::main]
14async fn main(_spawner: Spawner, p: Peripherals) { 14async fn main(_spawner: Spawner, p: Peripherals) {
15 let mut config = uarte::Config::default(); 15 let mut config = uarte::Config::default();
16 config.parity = uarte::Parity::EXCLUDED; 16 config.parity = uarte::Parity::EXCLUDED;
diff --git a/examples/nrf/src/bin/channel.rs b/examples/nrf/src/bin/channel.rs
index c57b91a42..e97c6c5ee 100644
--- a/examples/nrf/src/bin/channel.rs
+++ b/examples/nrf/src/bin/channel.rs
@@ -3,12 +3,12 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::unwrap; 5use defmt::unwrap;
6use embassy::blocking_mutex::raw::ThreadModeRawMutex; 6use embassy_executor::executor::Spawner;
7use embassy::channel::mpmc::Channel; 7use embassy_executor::time::{Duration, Timer};
8use embassy::executor::Spawner;
9use embassy::time::{Duration, Timer};
10use embassy_nrf::gpio::{Level, Output, OutputDrive}; 8use embassy_nrf::gpio::{Level, Output, OutputDrive};
11use embassy_nrf::Peripherals; 9use embassy_nrf::Peripherals;
10use embassy_util::blocking_mutex::raw::ThreadModeRawMutex;
11use embassy_util::channel::mpmc::Channel;
12use {defmt_rtt as _, panic_probe as _}; 12use {defmt_rtt as _, panic_probe as _};
13 13
14enum LedState { 14enum LedState {
@@ -18,7 +18,7 @@ enum LedState {
18 18
19static CHANNEL: Channel<ThreadModeRawMutex, LedState, 1> = Channel::new(); 19static CHANNEL: Channel<ThreadModeRawMutex, LedState, 1> = Channel::new();
20 20
21#[embassy::task] 21#[embassy_executor::task]
22async fn my_task() { 22async fn my_task() {
23 loop { 23 loop {
24 CHANNEL.send(LedState::On).await; 24 CHANNEL.send(LedState::On).await;
@@ -28,7 +28,7 @@ async fn my_task() {
28 } 28 }
29} 29}
30 30
31#[embassy::main] 31#[embassy_executor::main]
32async fn main(spawner: Spawner, p: Peripherals) { 32async fn main(spawner: Spawner, p: Peripherals) {
33 let mut led = Output::new(p.P0_13, Level::Low, OutputDrive::Standard); 33 let mut led = Output::new(p.P0_13, Level::Low, OutputDrive::Standard);
34 34
diff --git a/examples/nrf/src/bin/channel_sender_receiver.rs b/examples/nrf/src/bin/channel_sender_receiver.rs
index 847ce2382..bca7bb248 100644
--- a/examples/nrf/src/bin/channel_sender_receiver.rs
+++ b/examples/nrf/src/bin/channel_sender_receiver.rs
@@ -3,13 +3,13 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::unwrap; 5use defmt::unwrap;
6use embassy::blocking_mutex::raw::NoopRawMutex; 6use embassy_executor::executor::Spawner;
7use embassy::channel::mpmc::{Channel, Receiver, Sender}; 7use embassy_executor::time::{Duration, Timer};
8use embassy::executor::Spawner;
9use embassy::time::{Duration, Timer};
10use embassy::util::Forever;
11use embassy_nrf::gpio::{AnyPin, Level, Output, OutputDrive, Pin}; 8use embassy_nrf::gpio::{AnyPin, Level, Output, OutputDrive, Pin};
12use embassy_nrf::Peripherals; 9use embassy_nrf::Peripherals;
10use embassy_util::blocking_mutex::raw::NoopRawMutex;
11use embassy_util::channel::mpmc::{Channel, Receiver, Sender};
12use embassy_util::Forever;
13use {defmt_rtt as _, panic_probe as _}; 13use {defmt_rtt as _, panic_probe as _};
14 14
15enum LedState { 15enum LedState {
@@ -19,7 +19,7 @@ enum LedState {
19 19
20static CHANNEL: Forever<Channel<NoopRawMutex, LedState, 1>> = Forever::new(); 20static CHANNEL: Forever<Channel<NoopRawMutex, LedState, 1>> = Forever::new();
21 21
22#[embassy::task] 22#[embassy_executor::task]
23async fn send_task(sender: Sender<'static, NoopRawMutex, LedState, 1>) { 23async fn send_task(sender: Sender<'static, NoopRawMutex, LedState, 1>) {
24 loop { 24 loop {
25 sender.send(LedState::On).await; 25 sender.send(LedState::On).await;
@@ -29,7 +29,7 @@ async fn send_task(sender: Sender<'static, NoopRawMutex, LedState, 1>) {
29 } 29 }
30} 30}
31 31
32#[embassy::task] 32#[embassy_executor::task]
33async fn recv_task(led: AnyPin, receiver: Receiver<'static, NoopRawMutex, LedState, 1>) { 33async fn recv_task(led: AnyPin, receiver: Receiver<'static, NoopRawMutex, LedState, 1>) {
34 let mut led = Output::new(led, Level::Low, OutputDrive::Standard); 34 let mut led = Output::new(led, Level::Low, OutputDrive::Standard);
35 35
@@ -41,7 +41,7 @@ async fn recv_task(led: AnyPin, receiver: Receiver<'static, NoopRawMutex, LedSta
41 } 41 }
42} 42}
43 43
44#[embassy::main] 44#[embassy_executor::main]
45async fn main(spawner: Spawner, p: Peripherals) { 45async fn main(spawner: Spawner, p: Peripherals) {
46 let channel = CHANNEL.put(Channel::new()); 46 let channel = CHANNEL.put(Channel::new());
47 47
diff --git a/examples/nrf/src/bin/executor_fairness_test.rs b/examples/nrf/src/bin/executor_fairness_test.rs
index 5a4221519..b98454936 100644
--- a/examples/nrf/src/bin/executor_fairness_test.rs
+++ b/examples/nrf/src/bin/executor_fairness_test.rs
@@ -5,12 +5,12 @@
5use core::task::Poll; 5use core::task::Poll;
6 6
7use defmt::{info, unwrap}; 7use defmt::{info, unwrap};
8use embassy::executor::Spawner; 8use embassy_executor::executor::Spawner;
9use embassy::time::{Duration, Instant, Timer}; 9use embassy_executor::time::{Duration, Instant, Timer};
10use embassy_nrf::Peripherals; 10use embassy_nrf::Peripherals;
11use {defmt_rtt as _, panic_probe as _}; 11use {defmt_rtt as _, panic_probe as _};
12 12
13#[embassy::task] 13#[embassy_executor::task]
14async fn run1() { 14async fn run1() {
15 loop { 15 loop {
16 info!("DING DONG"); 16 info!("DING DONG");
@@ -18,14 +18,14 @@ async fn run1() {
18 } 18 }
19} 19}
20 20
21#[embassy::task] 21#[embassy_executor::task]
22async fn run2() { 22async fn run2() {
23 loop { 23 loop {
24 Timer::at(Instant::from_ticks(0)).await; 24 Timer::at(Instant::from_ticks(0)).await;
25 } 25 }
26} 26}
27 27
28#[embassy::task] 28#[embassy_executor::task]
29async fn run3() { 29async fn run3() {
30 futures::future::poll_fn(|cx| { 30 futures::future::poll_fn(|cx| {
31 cx.waker().wake_by_ref(); 31 cx.waker().wake_by_ref();
@@ -34,7 +34,7 @@ async fn run3() {
34 .await; 34 .await;
35} 35}
36 36
37#[embassy::main] 37#[embassy_executor::main]
38async fn main(spawner: Spawner, _p: Peripherals) { 38async fn main(spawner: Spawner, _p: Peripherals) {
39 unwrap!(spawner.spawn(run1())); 39 unwrap!(spawner.spawn(run1()));
40 unwrap!(spawner.spawn(run2())); 40 unwrap!(spawner.spawn(run2()));
diff --git a/examples/nrf/src/bin/gpiote_channel.rs b/examples/nrf/src/bin/gpiote_channel.rs
index ad8f37c6e..65c7b4df7 100644
--- a/examples/nrf/src/bin/gpiote_channel.rs
+++ b/examples/nrf/src/bin/gpiote_channel.rs
@@ -3,13 +3,13 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::info; 5use defmt::info;
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy_nrf::gpio::{Input, Pull}; 7use embassy_nrf::gpio::{Input, Pull};
8use embassy_nrf::gpiote::{InputChannel, InputChannelPolarity}; 8use embassy_nrf::gpiote::{InputChannel, InputChannelPolarity};
9use embassy_nrf::Peripherals; 9use embassy_nrf::Peripherals;
10use {defmt_rtt as _, panic_probe as _}; 10use {defmt_rtt as _, panic_probe as _};
11 11
12#[embassy::main] 12#[embassy_executor::main]
13async fn main(_spawner: Spawner, p: Peripherals) { 13async fn main(_spawner: Spawner, p: Peripherals) {
14 info!("Starting!"); 14 info!("Starting!");
15 15
diff --git a/examples/nrf/src/bin/gpiote_port.rs b/examples/nrf/src/bin/gpiote_port.rs
index 30b87b3a7..7746a7f96 100644
--- a/examples/nrf/src/bin/gpiote_port.rs
+++ b/examples/nrf/src/bin/gpiote_port.rs
@@ -3,12 +3,12 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::{info, unwrap}; 5use defmt::{info, unwrap};
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy_nrf::gpio::{AnyPin, Input, Pin as _, Pull}; 7use embassy_nrf::gpio::{AnyPin, Input, Pin as _, Pull};
8use embassy_nrf::Peripherals; 8use embassy_nrf::Peripherals;
9use {defmt_rtt as _, panic_probe as _}; 9use {defmt_rtt as _, panic_probe as _};
10 10
11#[embassy::task(pool_size = 4)] 11#[embassy_executor::task(pool_size = 4)]
12async fn button_task(n: usize, mut pin: Input<'static, AnyPin>) { 12async fn button_task(n: usize, mut pin: Input<'static, AnyPin>) {
13 loop { 13 loop {
14 pin.wait_for_low().await; 14 pin.wait_for_low().await;
@@ -18,7 +18,7 @@ async fn button_task(n: usize, mut pin: Input<'static, AnyPin>) {
18 } 18 }
19} 19}
20 20
21#[embassy::main] 21#[embassy_executor::main]
22async fn main(spawner: Spawner, p: Peripherals) { 22async fn main(spawner: Spawner, p: Peripherals) {
23 info!("Starting!"); 23 info!("Starting!");
24 24
diff --git a/examples/nrf/src/bin/multiprio.rs b/examples/nrf/src/bin/multiprio.rs
index 1a4598e21..7050da378 100644
--- a/examples/nrf/src/bin/multiprio.rs
+++ b/examples/nrf/src/bin/multiprio.rs
@@ -59,14 +59,14 @@
59 59
60use cortex_m_rt::entry; 60use cortex_m_rt::entry;
61use defmt::{info, unwrap}; 61use defmt::{info, unwrap};
62use embassy::time::{Duration, Instant, Timer}; 62use embassy_executor::time::{Duration, Instant, Timer};
63use embassy::util::Forever;
64use embassy_nrf::executor::{Executor, InterruptExecutor}; 63use embassy_nrf::executor::{Executor, InterruptExecutor};
65use embassy_nrf::interrupt; 64use embassy_nrf::interrupt;
66use embassy_nrf::interrupt::InterruptExt; 65use embassy_nrf::interrupt::InterruptExt;
66use embassy_util::Forever;
67use {defmt_rtt as _, panic_probe as _}; 67use {defmt_rtt as _, panic_probe as _};
68 68
69#[embassy::task] 69#[embassy_executor::task]
70async fn run_high() { 70async fn run_high() {
71 loop { 71 loop {
72 info!(" [high] tick!"); 72 info!(" [high] tick!");
@@ -74,7 +74,7 @@ async fn run_high() {
74 } 74 }
75} 75}
76 76
77#[embassy::task] 77#[embassy_executor::task]
78async fn run_med() { 78async fn run_med() {
79 loop { 79 loop {
80 let start = Instant::now(); 80 let start = Instant::now();
@@ -91,7 +91,7 @@ async fn run_med() {
91 } 91 }
92} 92}
93 93
94#[embassy::task] 94#[embassy_executor::task]
95async fn run_low() { 95async fn run_low() {
96 loop { 96 loop {
97 let start = Instant::now(); 97 let start = Instant::now();
diff --git a/examples/nrf/src/bin/mutex.rs b/examples/nrf/src/bin/mutex.rs
index 92e01976c..5fe7eadb9 100644
--- a/examples/nrf/src/bin/mutex.rs
+++ b/examples/nrf/src/bin/mutex.rs
@@ -3,16 +3,16 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::{info, unwrap}; 5use defmt::{info, unwrap};
6use embassy::blocking_mutex::raw::ThreadModeRawMutex; 6use embassy_executor::executor::Spawner;
7use embassy::executor::Spawner; 7use embassy_executor::time::{Duration, Timer};
8use embassy::mutex::Mutex;
9use embassy::time::{Duration, Timer};
10use embassy_nrf::Peripherals; 8use embassy_nrf::Peripherals;
9use embassy_util::blocking_mutex::raw::ThreadModeRawMutex;
10use embassy_util::mutex::Mutex;
11use {defmt_rtt as _, panic_probe as _}; 11use {defmt_rtt as _, panic_probe as _};
12 12
13static MUTEX: Mutex<ThreadModeRawMutex, u32> = Mutex::new(0); 13static MUTEX: Mutex<ThreadModeRawMutex, u32> = Mutex::new(0);
14 14
15#[embassy::task] 15#[embassy_executor::task]
16async fn my_task() { 16async fn my_task() {
17 loop { 17 loop {
18 { 18 {
@@ -29,7 +29,7 @@ async fn my_task() {
29 } 29 }
30} 30}
31 31
32#[embassy::main] 32#[embassy_executor::main]
33async fn main(spawner: Spawner, _p: Peripherals) { 33async fn main(spawner: Spawner, _p: Peripherals) {
34 unwrap!(spawner.spawn(my_task())); 34 unwrap!(spawner.spawn(my_task()));
35 35
diff --git a/examples/nrf/src/bin/nvmc.rs b/examples/nrf/src/bin/nvmc.rs
index b55ef1f6c..1d4387de7 100644
--- a/examples/nrf/src/bin/nvmc.rs
+++ b/examples/nrf/src/bin/nvmc.rs
@@ -3,14 +3,14 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::{info, unwrap}; 5use defmt::{info, unwrap};
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy::time::{Duration, Timer}; 7use embassy_executor::time::{Duration, Timer};
8use embassy_nrf::nvmc::Nvmc; 8use embassy_nrf::nvmc::Nvmc;
9use embassy_nrf::Peripherals; 9use embassy_nrf::Peripherals;
10use embedded_storage::nor_flash::{NorFlash, ReadNorFlash}; 10use embedded_storage::nor_flash::{NorFlash, ReadNorFlash};
11use {defmt_rtt as _, panic_probe as _}; 11use {defmt_rtt as _, panic_probe as _};
12 12
13#[embassy::main] 13#[embassy_executor::main]
14async fn main(_spawner: Spawner, p: Peripherals) { 14async fn main(_spawner: Spawner, p: Peripherals) {
15 info!("Hello NVMC!"); 15 info!("Hello NVMC!");
16 16
diff --git a/examples/nrf/src/bin/ppi.rs b/examples/nrf/src/bin/ppi.rs
index 004a1bfa4..9a60cc0a0 100644
--- a/examples/nrf/src/bin/ppi.rs
+++ b/examples/nrf/src/bin/ppi.rs
@@ -5,7 +5,7 @@
5use core::future::pending; 5use core::future::pending;
6 6
7use defmt::info; 7use defmt::info;
8use embassy::executor::Spawner; 8use embassy_executor::executor::Spawner;
9use embassy_nrf::gpio::{Input, Level, Output, OutputDrive, Pull}; 9use embassy_nrf::gpio::{Input, Level, Output, OutputDrive, Pull};
10use embassy_nrf::gpiote::{self, InputChannel, InputChannelPolarity}; 10use embassy_nrf::gpiote::{self, InputChannel, InputChannelPolarity};
11use embassy_nrf::ppi::Ppi; 11use embassy_nrf::ppi::Ppi;
@@ -13,7 +13,7 @@ use embassy_nrf::Peripherals;
13use gpiote::{OutputChannel, OutputChannelPolarity}; 13use gpiote::{OutputChannel, OutputChannelPolarity};
14use {defmt_rtt as _, panic_probe as _}; 14use {defmt_rtt as _, panic_probe as _};
15 15
16#[embassy::main] 16#[embassy_executor::main]
17async fn main(_spawner: Spawner, p: Peripherals) { 17async fn main(_spawner: Spawner, p: Peripherals) {
18 info!("Starting!"); 18 info!("Starting!");
19 19
diff --git a/examples/nrf/src/bin/pubsub.rs b/examples/nrf/src/bin/pubsub.rs
index 2c3a355c2..5f33f3e0b 100644
--- a/examples/nrf/src/bin/pubsub.rs
+++ b/examples/nrf/src/bin/pubsub.rs
@@ -3,10 +3,10 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::unwrap; 5use defmt::unwrap;
6use embassy::blocking_mutex::raw::ThreadModeRawMutex; 6use embassy_executor::executor::Spawner;
7use embassy::channel::pubsub::{DynSubscriber, PubSubChannel, Subscriber}; 7use embassy_executor::time::{Duration, Timer};
8use embassy::executor::Spawner; 8use embassy_util::blocking_mutex::raw::ThreadModeRawMutex;
9use embassy::time::{Duration, Timer}; 9use embassy_util::channel::pubsub::{DynSubscriber, PubSubChannel, Subscriber};
10use {defmt_rtt as _, panic_probe as _}; 10use {defmt_rtt as _, panic_probe as _};
11 11
12/// Create the message bus. It has a queue of 4, supports 3 subscribers and 1 publisher 12/// Create the message bus. It has a queue of 4, supports 3 subscribers and 1 publisher
@@ -19,7 +19,7 @@ enum Message {
19 C, 19 C,
20} 20}
21 21
22#[embassy::main] 22#[embassy_executor::main]
23async fn main(spawner: Spawner, _p: embassy_nrf::Peripherals) { 23async fn main(spawner: Spawner, _p: embassy_nrf::Peripherals) {
24 defmt::info!("Hello World!"); 24 defmt::info!("Hello World!");
25 25
@@ -64,7 +64,7 @@ async fn main(spawner: Spawner, _p: embassy_nrf::Peripherals) {
64/// A logger task that just awaits the messages it receives 64/// A logger task that just awaits the messages it receives
65/// 65///
66/// This takes the generic `Subscriber`. This is most performant, but requires you to write down all of the generics 66/// This takes the generic `Subscriber`. This is most performant, but requires you to write down all of the generics
67#[embassy::task] 67#[embassy_executor::task]
68async fn fast_logger(mut messages: Subscriber<'static, ThreadModeRawMutex, Message, 4, 3, 1>) { 68async fn fast_logger(mut messages: Subscriber<'static, ThreadModeRawMutex, Message, 4, 3, 1>) {
69 loop { 69 loop {
70 let message = messages.next_message().await; 70 let message = messages.next_message().await;
@@ -76,7 +76,7 @@ async fn fast_logger(mut messages: Subscriber<'static, ThreadModeRawMutex, Messa
76/// Because of this, depeding on how the messages were published, the subscriber might miss some messages 76/// Because of this, depeding on how the messages were published, the subscriber might miss some messages
77/// 77///
78/// This takes the dynamic `DynSubscriber`. This is not as performant as the generic version, but let's you ignore some of the generics 78/// This takes the dynamic `DynSubscriber`. This is not as performant as the generic version, but let's you ignore some of the generics
79#[embassy::task] 79#[embassy_executor::task]
80async fn slow_logger(mut messages: DynSubscriber<'static, Message>) { 80async fn slow_logger(mut messages: DynSubscriber<'static, Message>) {
81 loop { 81 loop {
82 // Do some work 82 // Do some work
@@ -93,7 +93,7 @@ async fn slow_logger(mut messages: DynSubscriber<'static, Message>) {
93} 93}
94 94
95/// Same as `slow_logger` but it ignores lag results 95/// Same as `slow_logger` but it ignores lag results
96#[embassy::task] 96#[embassy_executor::task]
97async fn slow_logger_pure(mut messages: DynSubscriber<'static, Message>) { 97async fn slow_logger_pure(mut messages: DynSubscriber<'static, Message>) {
98 loop { 98 loop {
99 // Do some work 99 // Do some work
diff --git a/examples/nrf/src/bin/pwm.rs b/examples/nrf/src/bin/pwm.rs
index aec5dd73a..c8a083294 100644
--- a/examples/nrf/src/bin/pwm.rs
+++ b/examples/nrf/src/bin/pwm.rs
@@ -3,8 +3,8 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::*; 5use defmt::*;
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy::time::{Duration, Timer}; 7use embassy_executor::time::{Duration, Timer};
8use embassy_nrf::pwm::{Prescaler, SimplePwm}; 8use embassy_nrf::pwm::{Prescaler, SimplePwm};
9use embassy_nrf::Peripherals; 9use embassy_nrf::Peripherals;
10use {defmt_rtt as _, panic_probe as _}; 10use {defmt_rtt as _, panic_probe as _};
@@ -70,7 +70,7 @@ static DUTY: [u16; 1024] = [
70 7255, 7331, 7407, 7484, 7561, 7638, 7716, 7794, 7873, 7952, 8031, 8111, 70 7255, 7331, 7407, 7484, 7561, 7638, 7716, 7794, 7873, 7952, 8031, 8111,
71]; 71];
72 72
73#[embassy::main] 73#[embassy_executor::main]
74async fn main(_spawner: Spawner, p: Peripherals) { 74async fn main(_spawner: Spawner, p: Peripherals) {
75 let mut pwm = SimplePwm::new_4ch(p.PWM0, p.P0_13, p.P0_14, p.P0_16, p.P0_15); 75 let mut pwm = SimplePwm::new_4ch(p.PWM0, p.P0_13, p.P0_14, p.P0_16, p.P0_15);
76 pwm.set_prescaler(Prescaler::Div1); 76 pwm.set_prescaler(Prescaler::Div1);
diff --git a/examples/nrf/src/bin/pwm_double_sequence.rs b/examples/nrf/src/bin/pwm_double_sequence.rs
index facafa775..cfd8db86b 100644
--- a/examples/nrf/src/bin/pwm_double_sequence.rs
+++ b/examples/nrf/src/bin/pwm_double_sequence.rs
@@ -3,15 +3,15 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::*; 5use defmt::*;
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy::time::{Duration, Timer}; 7use embassy_executor::time::{Duration, Timer};
8use embassy_nrf::pwm::{ 8use embassy_nrf::pwm::{
9 Config, Prescaler, Sequence, SequenceConfig, SequenceMode, SequencePwm, Sequencer, StartSequence, 9 Config, Prescaler, Sequence, SequenceConfig, SequenceMode, SequencePwm, Sequencer, StartSequence,
10}; 10};
11use embassy_nrf::Peripherals; 11use embassy_nrf::Peripherals;
12use {defmt_rtt as _, panic_probe as _}; 12use {defmt_rtt as _, panic_probe as _};
13 13
14#[embassy::main] 14#[embassy_executor::main]
15async fn main(_spawner: Spawner, p: Peripherals) { 15async fn main(_spawner: Spawner, p: Peripherals) {
16 let seq_words_0: [u16; 5] = [1000, 250, 100, 50, 0]; 16 let seq_words_0: [u16; 5] = [1000, 250, 100, 50, 0];
17 let seq_words_1: [u16; 4] = [50, 100, 250, 1000]; 17 let seq_words_1: [u16; 4] = [50, 100, 250, 1000];
diff --git a/examples/nrf/src/bin/pwm_sequence.rs b/examples/nrf/src/bin/pwm_sequence.rs
index b7cb385c7..b7a04c036 100644
--- a/examples/nrf/src/bin/pwm_sequence.rs
+++ b/examples/nrf/src/bin/pwm_sequence.rs
@@ -3,13 +3,13 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::*; 5use defmt::*;
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy::time::{Duration, Timer}; 7use embassy_executor::time::{Duration, Timer};
8use embassy_nrf::pwm::{Config, Prescaler, SequenceConfig, SequencePwm, SingleSequenceMode, SingleSequencer}; 8use embassy_nrf::pwm::{Config, Prescaler, SequenceConfig, SequencePwm, SingleSequenceMode, SingleSequencer};
9use embassy_nrf::Peripherals; 9use embassy_nrf::Peripherals;
10use {defmt_rtt as _, panic_probe as _}; 10use {defmt_rtt as _, panic_probe as _};
11 11
12#[embassy::main] 12#[embassy_executor::main]
13async fn main(_spawner: Spawner, p: Peripherals) { 13async fn main(_spawner: Spawner, p: Peripherals) {
14 let seq_words: [u16; 5] = [1000, 250, 100, 50, 0]; 14 let seq_words: [u16; 5] = [1000, 250, 100, 50, 0];
15 15
diff --git a/examples/nrf/src/bin/pwm_sequence_ppi.rs b/examples/nrf/src/bin/pwm_sequence_ppi.rs
index d98e2ca76..f5c587c35 100644
--- a/examples/nrf/src/bin/pwm_sequence_ppi.rs
+++ b/examples/nrf/src/bin/pwm_sequence_ppi.rs
@@ -5,7 +5,7 @@
5use core::future::pending; 5use core::future::pending;
6 6
7use defmt::*; 7use defmt::*;
8use embassy::executor::Spawner; 8use embassy_executor::executor::Spawner;
9use embassy_nrf::gpio::{Input, Pull}; 9use embassy_nrf::gpio::{Input, Pull};
10use embassy_nrf::gpiote::{InputChannel, InputChannelPolarity}; 10use embassy_nrf::gpiote::{InputChannel, InputChannelPolarity};
11use embassy_nrf::ppi::Ppi; 11use embassy_nrf::ppi::Ppi;
@@ -13,7 +13,7 @@ use embassy_nrf::pwm::{Config, Prescaler, SequenceConfig, SequencePwm, SingleSeq
13use embassy_nrf::Peripherals; 13use embassy_nrf::Peripherals;
14use {defmt_rtt as _, panic_probe as _}; 14use {defmt_rtt as _, panic_probe as _};
15 15
16#[embassy::main] 16#[embassy_executor::main]
17async fn main(_spawner: Spawner, p: Peripherals) { 17async fn main(_spawner: Spawner, p: Peripherals) {
18 let seq_words: [u16; 5] = [1000, 250, 100, 50, 0]; 18 let seq_words: [u16; 5] = [1000, 250, 100, 50, 0];
19 19
diff --git a/examples/nrf/src/bin/pwm_sequence_ws2812b.rs b/examples/nrf/src/bin/pwm_sequence_ws2812b.rs
index 0dee8c949..d6b3f005c 100644
--- a/examples/nrf/src/bin/pwm_sequence_ws2812b.rs
+++ b/examples/nrf/src/bin/pwm_sequence_ws2812b.rs
@@ -3,8 +3,8 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::*; 5use defmt::*;
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy::time::{Duration, Timer}; 7use embassy_executor::time::{Duration, Timer};
8use embassy_nrf::pwm::{ 8use embassy_nrf::pwm::{
9 Config, Prescaler, SequenceConfig, SequenceLoad, SequencePwm, SingleSequenceMode, SingleSequencer, 9 Config, Prescaler, SequenceConfig, SequenceLoad, SequencePwm, SingleSequenceMode, SingleSequencer,
10}; 10};
@@ -26,7 +26,7 @@ const RES: u16 = 0x8000;
26 26
27// Provides data to a WS2812b (Neopixel) LED and makes it go blue. The data 27// Provides data to a WS2812b (Neopixel) LED and makes it go blue. The data
28// line is assumed to be P1_05. 28// line is assumed to be P1_05.
29#[embassy::main] 29#[embassy_executor::main]
30async fn main(_spawner: Spawner, p: Peripherals) { 30async fn main(_spawner: Spawner, p: Peripherals) {
31 let mut config = Config::default(); 31 let mut config = Config::default();
32 config.sequence_load = SequenceLoad::Common; 32 config.sequence_load = SequenceLoad::Common;
diff --git a/examples/nrf/src/bin/pwm_servo.rs b/examples/nrf/src/bin/pwm_servo.rs
index 71a90a948..d28a5a17e 100644
--- a/examples/nrf/src/bin/pwm_servo.rs
+++ b/examples/nrf/src/bin/pwm_servo.rs
@@ -3,13 +3,13 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::*; 5use defmt::*;
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy::time::{Duration, Timer}; 7use embassy_executor::time::{Duration, Timer};
8use embassy_nrf::pwm::{Prescaler, SimplePwm}; 8use embassy_nrf::pwm::{Prescaler, SimplePwm};
9use embassy_nrf::Peripherals; 9use embassy_nrf::Peripherals;
10use {defmt_rtt as _, panic_probe as _}; 10use {defmt_rtt as _, panic_probe as _};
11 11
12#[embassy::main] 12#[embassy_executor::main]
13async fn main(_spawner: Spawner, p: Peripherals) { 13async fn main(_spawner: Spawner, p: Peripherals) {
14 let mut pwm = SimplePwm::new_1ch(p.PWM0, p.P0_05); 14 let mut pwm = SimplePwm::new_1ch(p.PWM0, p.P0_05);
15 // sg90 microervo requires 50hz or 20ms period 15 // sg90 microervo requires 50hz or 20ms period
diff --git a/examples/nrf/src/bin/qdec.rs b/examples/nrf/src/bin/qdec.rs
index 9529c7bb6..6bda82f78 100644
--- a/examples/nrf/src/bin/qdec.rs
+++ b/examples/nrf/src/bin/qdec.rs
@@ -3,12 +3,12 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::info; 5use defmt::info;
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy_nrf::qdec::{self, Qdec}; 7use embassy_nrf::qdec::{self, Qdec};
8use embassy_nrf::{interrupt, Peripherals}; 8use embassy_nrf::{interrupt, Peripherals};
9use {defmt_rtt as _, panic_probe as _}; 9use {defmt_rtt as _, panic_probe as _};
10 10
11#[embassy::main] 11#[embassy_executor::main]
12async fn main(_spawner: Spawner, p: Peripherals) { 12async fn main(_spawner: Spawner, p: Peripherals) {
13 let irq = interrupt::take!(QDEC); 13 let irq = interrupt::take!(QDEC);
14 let config = qdec::Config::default(); 14 let config = qdec::Config::default();
diff --git a/examples/nrf/src/bin/qspi.rs b/examples/nrf/src/bin/qspi.rs
index 96c90f9c8..57e0fdbe2 100644
--- a/examples/nrf/src/bin/qspi.rs
+++ b/examples/nrf/src/bin/qspi.rs
@@ -3,7 +3,7 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::{assert_eq, info, unwrap}; 5use defmt::{assert_eq, info, unwrap};
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy_nrf::{interrupt, qspi, Peripherals}; 7use embassy_nrf::{interrupt, qspi, Peripherals};
8use {defmt_rtt as _, panic_probe as _}; 8use {defmt_rtt as _, panic_probe as _};
9 9
@@ -14,7 +14,7 @@ const PAGE_SIZE: usize = 4096;
14#[repr(C, align(4))] 14#[repr(C, align(4))]
15struct AlignedBuf([u8; 4096]); 15struct AlignedBuf([u8; 4096]);
16 16
17#[embassy::main] 17#[embassy_executor::main]
18async fn main(_spawner: Spawner, p: Peripherals) { 18async fn main(_spawner: Spawner, p: Peripherals) {
19 // Config for the MX25R64 present in the nRF52840 DK 19 // Config for the MX25R64 present in the nRF52840 DK
20 let mut config = qspi::Config::default(); 20 let mut config = qspi::Config::default();
diff --git a/examples/nrf/src/bin/qspi_lowpower.rs b/examples/nrf/src/bin/qspi_lowpower.rs
index ce2e40b23..080b27a16 100644
--- a/examples/nrf/src/bin/qspi_lowpower.rs
+++ b/examples/nrf/src/bin/qspi_lowpower.rs
@@ -5,8 +5,8 @@
5use core::mem; 5use core::mem;
6 6
7use defmt::{info, unwrap}; 7use defmt::{info, unwrap};
8use embassy::executor::Spawner; 8use embassy_executor::executor::Spawner;
9use embassy::time::{Duration, Timer}; 9use embassy_executor::time::{Duration, Timer};
10use embassy_nrf::{interrupt, qspi, Peripherals}; 10use embassy_nrf::{interrupt, qspi, Peripherals};
11use {defmt_rtt as _, panic_probe as _}; 11use {defmt_rtt as _, panic_probe as _};
12 12
@@ -15,7 +15,7 @@ use {defmt_rtt as _, panic_probe as _};
15#[repr(C, align(4))] 15#[repr(C, align(4))]
16struct AlignedBuf([u8; 64]); 16struct AlignedBuf([u8; 64]);
17 17
18#[embassy::main] 18#[embassy_executor::main]
19async fn main(_spawner: Spawner, mut p: Peripherals) { 19async fn main(_spawner: Spawner, mut p: Peripherals) {
20 let mut irq = interrupt::take!(QSPI); 20 let mut irq = interrupt::take!(QSPI);
21 21
diff --git a/examples/nrf/src/bin/raw_spawn.rs b/examples/nrf/src/bin/raw_spawn.rs
index d564b6b26..9199d3aeb 100644
--- a/examples/nrf/src/bin/raw_spawn.rs
+++ b/examples/nrf/src/bin/raw_spawn.rs
@@ -5,10 +5,10 @@ use core::mem;
5 5
6use cortex_m_rt::entry; 6use cortex_m_rt::entry;
7use defmt::{info, unwrap}; 7use defmt::{info, unwrap};
8use embassy::executor::raw::TaskStorage; 8use embassy_executor::executor::raw::TaskStorage;
9use embassy::executor::Executor; 9use embassy_executor::executor::Executor;
10use embassy::time::{Duration, Timer}; 10use embassy_executor::time::{Duration, Timer};
11use embassy::util::Forever; 11use embassy_util::Forever;
12use {defmt_rtt as _, panic_probe as _}; 12use {defmt_rtt as _, panic_probe as _};
13 13
14async fn run1() { 14async fn run1() {
diff --git a/examples/nrf/src/bin/rng.rs b/examples/nrf/src/bin/rng.rs
index 08d3abe10..a4314e8b9 100644
--- a/examples/nrf/src/bin/rng.rs
+++ b/examples/nrf/src/bin/rng.rs
@@ -2,13 +2,13 @@
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use embassy::executor::Spawner; 5use embassy_executor::executor::Spawner;
6use embassy_nrf::rng::Rng; 6use embassy_nrf::rng::Rng;
7use embassy_nrf::{interrupt, Peripherals}; 7use embassy_nrf::{interrupt, Peripherals};
8use rand::Rng as _; 8use rand::Rng as _;
9use {defmt_rtt as _, panic_probe as _}; 9use {defmt_rtt as _, panic_probe as _};
10 10
11#[embassy::main] 11#[embassy_executor::main]
12async fn main(_spawner: Spawner, p: Peripherals) { 12async fn main(_spawner: Spawner, p: Peripherals) {
13 let mut rng = Rng::new(p.RNG, interrupt::take!(RNG)); 13 let mut rng = Rng::new(p.RNG, interrupt::take!(RNG));
14 14
diff --git a/examples/nrf/src/bin/saadc.rs b/examples/nrf/src/bin/saadc.rs
index cb9289784..65c78d842 100644
--- a/examples/nrf/src/bin/saadc.rs
+++ b/examples/nrf/src/bin/saadc.rs
@@ -3,13 +3,13 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::info; 5use defmt::info;
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy::time::{Duration, Timer}; 7use embassy_executor::time::{Duration, Timer};
8use embassy_nrf::saadc::{ChannelConfig, Config, Saadc}; 8use embassy_nrf::saadc::{ChannelConfig, Config, Saadc};
9use embassy_nrf::{interrupt, Peripherals}; 9use embassy_nrf::{interrupt, Peripherals};
10use {defmt_rtt as _, panic_probe as _}; 10use {defmt_rtt as _, panic_probe as _};
11 11
12#[embassy::main] 12#[embassy_executor::main]
13async fn main(_spawner: Spawner, mut p: Peripherals) { 13async fn main(_spawner: Spawner, mut p: Peripherals) {
14 let config = Config::default(); 14 let config = Config::default();
15 let channel_config = ChannelConfig::single_ended(&mut p.P0_02); 15 let channel_config = ChannelConfig::single_ended(&mut p.P0_02);
diff --git a/examples/nrf/src/bin/saadc_continuous.rs b/examples/nrf/src/bin/saadc_continuous.rs
index 234294eae..d0305736f 100644
--- a/examples/nrf/src/bin/saadc_continuous.rs
+++ b/examples/nrf/src/bin/saadc_continuous.rs
@@ -3,8 +3,8 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::info; 5use defmt::info;
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy::time::Duration; 7use embassy_executor::time::Duration;
8use embassy_nrf::saadc::{ChannelConfig, Config, Saadc, SamplerState}; 8use embassy_nrf::saadc::{ChannelConfig, Config, Saadc, SamplerState};
9use embassy_nrf::timer::Frequency; 9use embassy_nrf::timer::Frequency;
10use embassy_nrf::{interrupt, Peripherals}; 10use embassy_nrf::{interrupt, Peripherals};
@@ -12,7 +12,7 @@ use {defmt_rtt as _, panic_probe as _};
12 12
13// Demonstrates both continuous sampling and scanning multiple channels driven by a PPI linked timer 13// Demonstrates both continuous sampling and scanning multiple channels driven by a PPI linked timer
14 14
15#[embassy::main] 15#[embassy_executor::main]
16async fn main(_spawner: Spawner, mut p: Peripherals) { 16async fn main(_spawner: Spawner, mut p: Peripherals) {
17 let config = Config::default(); 17 let config = Config::default();
18 let channel_1_config = ChannelConfig::single_ended(&mut p.P0_02); 18 let channel_1_config = ChannelConfig::single_ended(&mut p.P0_02);
@@ -27,7 +27,7 @@ async fn main(_spawner: Spawner, mut p: Peripherals) {
27 27
28 // This delay demonstrates that starting the timer prior to running 28 // This delay demonstrates that starting the timer prior to running
29 // the task sampler is benign given the calibration that follows. 29 // the task sampler is benign given the calibration that follows.
30 embassy::time::Timer::after(Duration::from_millis(500)).await; 30 embassy_executor::time::Timer::after(Duration::from_millis(500)).await;
31 saadc.calibrate().await; 31 saadc.calibrate().await;
32 32
33 let mut bufs = [[[0; 3]; 500]; 2]; 33 let mut bufs = [[[0; 3]; 500]; 2];
diff --git a/examples/nrf/src/bin/self_spawn.rs b/examples/nrf/src/bin/self_spawn.rs
index 4b8ac04bc..e0152802e 100644
--- a/examples/nrf/src/bin/self_spawn.rs
+++ b/examples/nrf/src/bin/self_spawn.rs
@@ -3,19 +3,19 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::{info, unwrap}; 5use defmt::{info, unwrap};
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy::time::{Duration, Timer}; 7use embassy_executor::time::{Duration, Timer};
8use embassy_nrf::Peripherals; 8use embassy_nrf::Peripherals;
9use {defmt_rtt as _, panic_probe as _}; 9use {defmt_rtt as _, panic_probe as _};
10 10
11#[embassy::task(pool_size = 2)] 11#[embassy_executor::task(pool_size = 2)]
12async fn my_task(spawner: Spawner, n: u32) { 12async fn my_task(spawner: Spawner, n: u32) {
13 Timer::after(Duration::from_secs(1)).await; 13 Timer::after(Duration::from_secs(1)).await;
14 info!("Spawning self! {}", n); 14 info!("Spawning self! {}", n);
15 unwrap!(spawner.spawn(my_task(spawner, n + 1))); 15 unwrap!(spawner.spawn(my_task(spawner, n + 1)));
16} 16}
17 17
18#[embassy::main] 18#[embassy_executor::main]
19async fn main(spawner: Spawner, _p: Peripherals) { 19async fn main(spawner: Spawner, _p: Peripherals) {
20 info!("Hello World!"); 20 info!("Hello World!");
21 unwrap!(spawner.spawn(my_task(spawner, 0))); 21 unwrap!(spawner.spawn(my_task(spawner, 0)));
diff --git a/examples/nrf/src/bin/self_spawn_current_executor.rs b/examples/nrf/src/bin/self_spawn_current_executor.rs
index 3c3379ce6..1d8309d77 100644
--- a/examples/nrf/src/bin/self_spawn_current_executor.rs
+++ b/examples/nrf/src/bin/self_spawn_current_executor.rs
@@ -3,19 +3,19 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::{info, unwrap}; 5use defmt::{info, unwrap};
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy::time::{Duration, Timer}; 7use embassy_executor::time::{Duration, Timer};
8use embassy_nrf::Peripherals; 8use embassy_nrf::Peripherals;
9use {defmt_rtt as _, panic_probe as _}; 9use {defmt_rtt as _, panic_probe as _};
10 10
11#[embassy::task(pool_size = 2)] 11#[embassy_executor::task(pool_size = 2)]
12async fn my_task(n: u32) { 12async fn my_task(n: u32) {
13 Timer::after(Duration::from_secs(1)).await; 13 Timer::after(Duration::from_secs(1)).await;
14 info!("Spawning self! {}", n); 14 info!("Spawning self! {}", n);
15 unwrap!(Spawner::for_current_executor().await.spawn(my_task(n + 1))); 15 unwrap!(Spawner::for_current_executor().await.spawn(my_task(n + 1)));
16} 16}
17 17
18#[embassy::main] 18#[embassy_executor::main]
19async fn main(spawner: Spawner, _p: Peripherals) { 19async fn main(spawner: Spawner, _p: Peripherals) {
20 info!("Hello World!"); 20 info!("Hello World!");
21 unwrap!(spawner.spawn(my_task(0))); 21 unwrap!(spawner.spawn(my_task(0)));
diff --git a/examples/nrf/src/bin/spim.rs b/examples/nrf/src/bin/spim.rs
index 62040168a..fd741b21c 100644
--- a/examples/nrf/src/bin/spim.rs
+++ b/examples/nrf/src/bin/spim.rs
@@ -3,12 +3,12 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::{info, unwrap}; 5use defmt::{info, unwrap};
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy_nrf::gpio::{Level, Output, OutputDrive}; 7use embassy_nrf::gpio::{Level, Output, OutputDrive};
8use embassy_nrf::{interrupt, spim, Peripherals}; 8use embassy_nrf::{interrupt, spim, Peripherals};
9use {defmt_rtt as _, panic_probe as _}; 9use {defmt_rtt as _, panic_probe as _};
10 10
11#[embassy::main] 11#[embassy_executor::main]
12async fn main(_spawner: Spawner, p: Peripherals) { 12async fn main(_spawner: Spawner, p: Peripherals) {
13 info!("running!"); 13 info!("running!");
14 14
diff --git a/examples/nrf/src/bin/temp.rs b/examples/nrf/src/bin/temp.rs
index 939cb39e7..654098e0b 100644
--- a/examples/nrf/src/bin/temp.rs
+++ b/examples/nrf/src/bin/temp.rs
@@ -3,13 +3,13 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::info; 5use defmt::info;
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy::time::{Duration, Timer}; 7use embassy_executor::time::{Duration, Timer};
8use embassy_nrf::temp::Temp; 8use embassy_nrf::temp::Temp;
9use embassy_nrf::{interrupt, Peripherals}; 9use embassy_nrf::{interrupt, Peripherals};
10use {defmt_rtt as _, panic_probe as _}; 10use {defmt_rtt as _, panic_probe as _};
11 11
12#[embassy::main] 12#[embassy_executor::main]
13async fn main(_spawner: Spawner, p: Peripherals) { 13async fn main(_spawner: Spawner, p: Peripherals) {
14 let irq = interrupt::take!(TEMP); 14 let irq = interrupt::take!(TEMP);
15 let mut temp = Temp::new(p.TEMP, irq); 15 let mut temp = Temp::new(p.TEMP, irq);
diff --git a/examples/nrf/src/bin/timer.rs b/examples/nrf/src/bin/timer.rs
index 64376dd78..61ff1d6db 100644
--- a/examples/nrf/src/bin/timer.rs
+++ b/examples/nrf/src/bin/timer.rs
@@ -3,12 +3,12 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::{info, unwrap}; 5use defmt::{info, unwrap};
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy::time::{Duration, Timer}; 7use embassy_executor::time::{Duration, Timer};
8use embassy_nrf::Peripherals; 8use embassy_nrf::Peripherals;
9use {defmt_rtt as _, panic_probe as _}; 9use {defmt_rtt as _, panic_probe as _};
10 10
11#[embassy::task] 11#[embassy_executor::task]
12async fn run1() { 12async fn run1() {
13 loop { 13 loop {
14 info!("BIG INFREQUENT TICK"); 14 info!("BIG INFREQUENT TICK");
@@ -16,7 +16,7 @@ async fn run1() {
16 } 16 }
17} 17}
18 18
19#[embassy::task] 19#[embassy_executor::task]
20async fn run2() { 20async fn run2() {
21 loop { 21 loop {
22 info!("tick"); 22 info!("tick");
@@ -24,7 +24,7 @@ async fn run2() {
24 } 24 }
25} 25}
26 26
27#[embassy::main] 27#[embassy_executor::main]
28async fn main(spawner: Spawner, _p: Peripherals) { 28async fn main(spawner: Spawner, _p: Peripherals) {
29 unwrap!(spawner.spawn(run1())); 29 unwrap!(spawner.spawn(run1()));
30 unwrap!(spawner.spawn(run2())); 30 unwrap!(spawner.spawn(run2()));
diff --git a/examples/nrf/src/bin/twim.rs b/examples/nrf/src/bin/twim.rs
index fb8372a12..bb7ee9db4 100644
--- a/examples/nrf/src/bin/twim.rs
+++ b/examples/nrf/src/bin/twim.rs
@@ -7,14 +7,14 @@
7#![feature(type_alias_impl_trait)] 7#![feature(type_alias_impl_trait)]
8 8
9use defmt::*; 9use defmt::*;
10use embassy::executor::Spawner; 10use embassy_executor::executor::Spawner;
11use embassy_nrf::twim::{self, Twim}; 11use embassy_nrf::twim::{self, Twim};
12use embassy_nrf::{interrupt, Peripherals}; 12use embassy_nrf::{interrupt, Peripherals};
13use {defmt_rtt as _, panic_probe as _}; 13use {defmt_rtt as _, panic_probe as _};
14 14
15const ADDRESS: u8 = 0x50; 15const ADDRESS: u8 = 0x50;
16 16
17#[embassy::main] 17#[embassy_executor::main]
18async fn main(_spawner: Spawner, p: Peripherals) { 18async fn main(_spawner: Spawner, p: Peripherals) {
19 info!("Initializing TWI..."); 19 info!("Initializing TWI...");
20 let config = twim::Config::default(); 20 let config = twim::Config::default();
diff --git a/examples/nrf/src/bin/twim_lowpower.rs b/examples/nrf/src/bin/twim_lowpower.rs
index c9c2d503e..ebf3d7109 100644
--- a/examples/nrf/src/bin/twim_lowpower.rs
+++ b/examples/nrf/src/bin/twim_lowpower.rs
@@ -11,15 +11,15 @@
11use core::mem; 11use core::mem;
12 12
13use defmt::*; 13use defmt::*;
14use embassy::executor::Spawner; 14use embassy_executor::executor::Spawner;
15use embassy::time::{Duration, Timer}; 15use embassy_executor::time::{Duration, Timer};
16use embassy_nrf::twim::{self, Twim}; 16use embassy_nrf::twim::{self, Twim};
17use embassy_nrf::{interrupt, Peripherals}; 17use embassy_nrf::{interrupt, Peripherals};
18use {defmt_rtt as _, panic_probe as _}; 18use {defmt_rtt as _, panic_probe as _};
19 19
20const ADDRESS: u8 = 0x50; 20const ADDRESS: u8 = 0x50;
21 21
22#[embassy::main] 22#[embassy_executor::main]
23async fn main(_spawner: Spawner, mut p: Peripherals) { 23async fn main(_spawner: Spawner, mut p: Peripherals) {
24 info!("Started!"); 24 info!("Started!");
25 let mut irq = interrupt::take!(SPIM0_SPIS0_TWIM0_TWIS0_SPI0_TWI0); 25 let mut irq = interrupt::take!(SPIM0_SPIS0_TWIM0_TWIS0_SPI0_TWI0);
diff --git a/examples/nrf/src/bin/uart.rs b/examples/nrf/src/bin/uart.rs
index c8c4a67a5..5f363b69e 100644
--- a/examples/nrf/src/bin/uart.rs
+++ b/examples/nrf/src/bin/uart.rs
@@ -3,11 +3,11 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::*; 5use defmt::*;
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy_nrf::{interrupt, uarte, Peripherals}; 7use embassy_nrf::{interrupt, uarte, Peripherals};
8use {defmt_rtt as _, panic_probe as _}; 8use {defmt_rtt as _, panic_probe as _};
9 9
10#[embassy::main] 10#[embassy_executor::main]
11async fn main(_spawner: Spawner, p: Peripherals) { 11async fn main(_spawner: Spawner, p: Peripherals) {
12 let mut config = uarte::Config::default(); 12 let mut config = uarte::Config::default();
13 config.parity = uarte::Parity::EXCLUDED; 13 config.parity = uarte::Parity::EXCLUDED;
diff --git a/examples/nrf/src/bin/uart_idle.rs b/examples/nrf/src/bin/uart_idle.rs
index 6679b28da..0f455dffd 100644
--- a/examples/nrf/src/bin/uart_idle.rs
+++ b/examples/nrf/src/bin/uart_idle.rs
@@ -3,11 +3,11 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::*; 5use defmt::*;
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy_nrf::{interrupt, uarte, Peripherals}; 7use embassy_nrf::{interrupt, uarte, Peripherals};
8use {defmt_rtt as _, panic_probe as _}; 8use {defmt_rtt as _, panic_probe as _};
9 9
10#[embassy::main] 10#[embassy_executor::main]
11async fn main(_spawner: Spawner, p: Peripherals) { 11async fn main(_spawner: Spawner, p: Peripherals) {
12 let mut config = uarte::Config::default(); 12 let mut config = uarte::Config::default();
13 config.parity = uarte::Parity::EXCLUDED; 13 config.parity = uarte::Parity::EXCLUDED;
diff --git a/examples/nrf/src/bin/uart_split.rs b/examples/nrf/src/bin/uart_split.rs
index 1ffb63706..2de5f90c1 100644
--- a/examples/nrf/src/bin/uart_split.rs
+++ b/examples/nrf/src/bin/uart_split.rs
@@ -3,17 +3,17 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::*; 5use defmt::*;
6use embassy::blocking_mutex::raw::ThreadModeRawMutex; 6use embassy_executor::executor::Spawner;
7use embassy::channel::mpmc::Channel;
8use embassy::executor::Spawner;
9use embassy_nrf::peripherals::UARTE0; 7use embassy_nrf::peripherals::UARTE0;
10use embassy_nrf::uarte::UarteRx; 8use embassy_nrf::uarte::UarteRx;
11use embassy_nrf::{interrupt, uarte, Peripherals}; 9use embassy_nrf::{interrupt, uarte, Peripherals};
10use embassy_util::blocking_mutex::raw::ThreadModeRawMutex;
11use embassy_util::channel::mpmc::Channel;
12use {defmt_rtt as _, panic_probe as _}; 12use {defmt_rtt as _, panic_probe as _};
13 13
14static CHANNEL: Channel<ThreadModeRawMutex, [u8; 8], 1> = Channel::new(); 14static CHANNEL: Channel<ThreadModeRawMutex, [u8; 8], 1> = Channel::new();
15 15
16#[embassy::main] 16#[embassy_executor::main]
17async fn main(spawner: Spawner, p: Peripherals) { 17async fn main(spawner: Spawner, p: Peripherals) {
18 let mut config = uarte::Config::default(); 18 let mut config = uarte::Config::default();
19 config.parity = uarte::Parity::EXCLUDED; 19 config.parity = uarte::Parity::EXCLUDED;
@@ -48,7 +48,7 @@ async fn main(spawner: Spawner, p: Peripherals) {
48 } 48 }
49} 49}
50 50
51#[embassy::task] 51#[embassy_executor::task]
52async fn reader(mut rx: UarteRx<'static, UARTE0>) { 52async fn reader(mut rx: UarteRx<'static, UARTE0>) {
53 let mut buf = [0; 8]; 53 let mut buf = [0; 8];
54 loop { 54 loop {
diff --git a/examples/nrf/src/bin/usb_ethernet.rs b/examples/nrf/src/bin/usb_ethernet.rs
index e57cdaf63..93cb05907 100644
--- a/examples/nrf/src/bin/usb_ethernet.rs
+++ b/examples/nrf/src/bin/usb_ethernet.rs
@@ -8,10 +8,7 @@ use core::sync::atomic::{AtomicBool, Ordering};
8use core::task::Waker; 8use core::task::Waker;
9 9
10use defmt::*; 10use defmt::*;
11use embassy::blocking_mutex::raw::ThreadModeRawMutex; 11use embassy_executor::executor::Spawner;
12use embassy::channel::mpmc::Channel;
13use embassy::executor::Spawner;
14use embassy::util::Forever;
15use embassy_net::tcp::TcpSocket; 12use embassy_net::tcp::TcpSocket;
16use embassy_net::{PacketBox, PacketBoxExt, PacketBuf, Stack, StackResources}; 13use embassy_net::{PacketBox, PacketBoxExt, PacketBuf, Stack, StackResources};
17use embassy_nrf::rng::Rng; 14use embassy_nrf::rng::Rng;
@@ -19,6 +16,9 @@ use embassy_nrf::usb::{Driver, PowerUsb};
19use embassy_nrf::{interrupt, pac, peripherals, Peripherals}; 16use embassy_nrf::{interrupt, pac, peripherals, Peripherals};
20use embassy_usb::{Builder, Config, UsbDevice}; 17use embassy_usb::{Builder, Config, UsbDevice};
21use embassy_usb_ncm::{CdcNcmClass, Receiver, Sender, State}; 18use embassy_usb_ncm::{CdcNcmClass, Receiver, Sender, State};
19use embassy_util::blocking_mutex::raw::ThreadModeRawMutex;
20use embassy_util::channel::mpmc::Channel;
21use embassy_util::Forever;
22use embedded_io::asynch::{Read, Write}; 22use embedded_io::asynch::{Read, Write};
23use {defmt_rtt as _, panic_probe as _}; 23use {defmt_rtt as _, panic_probe as _};
24 24
@@ -32,12 +32,12 @@ macro_rules! forever {
32 }}; 32 }};
33} 33}
34 34
35#[embassy::task] 35#[embassy_executor::task]
36async fn usb_task(mut device: UsbDevice<'static, MyDriver>) -> ! { 36async fn usb_task(mut device: UsbDevice<'static, MyDriver>) -> ! {
37 device.run().await 37 device.run().await
38} 38}
39 39
40#[embassy::task] 40#[embassy_executor::task]
41async fn usb_ncm_rx_task(mut class: Receiver<'static, MyDriver>) { 41async fn usb_ncm_rx_task(mut class: Receiver<'static, MyDriver>) {
42 loop { 42 loop {
43 warn!("WAITING for connection"); 43 warn!("WAITING for connection");
@@ -66,7 +66,7 @@ async fn usb_ncm_rx_task(mut class: Receiver<'static, MyDriver>) {
66 } 66 }
67} 67}
68 68
69#[embassy::task] 69#[embassy_executor::task]
70async fn usb_ncm_tx_task(mut class: Sender<'static, MyDriver>) { 70async fn usb_ncm_tx_task(mut class: Sender<'static, MyDriver>) {
71 loop { 71 loop {
72 let pkt = TX_CHANNEL.recv().await; 72 let pkt = TX_CHANNEL.recv().await;
@@ -76,12 +76,12 @@ async fn usb_ncm_tx_task(mut class: Sender<'static, MyDriver>) {
76 } 76 }
77} 77}
78 78
79#[embassy::task] 79#[embassy_executor::task]
80async fn net_task(stack: &'static Stack<Device>) -> ! { 80async fn net_task(stack: &'static Stack<Device>) -> ! {
81 stack.run().await 81 stack.run().await
82} 82}
83 83
84#[embassy::main] 84#[embassy_executor::main]
85async fn main(spawner: Spawner, p: Peripherals) { 85async fn main(spawner: Spawner, p: Peripherals) {
86 let clock: pac::CLOCK = unsafe { mem::transmute(()) }; 86 let clock: pac::CLOCK = unsafe { mem::transmute(()) };
87 87
diff --git a/examples/nrf/src/bin/usb_hid_keyboard.rs b/examples/nrf/src/bin/usb_hid_keyboard.rs
index 539ae6f16..863f3e5dd 100644
--- a/examples/nrf/src/bin/usb_hid_keyboard.rs
+++ b/examples/nrf/src/bin/usb_hid_keyboard.rs
@@ -7,23 +7,22 @@ use core::mem;
7use core::sync::atomic::{AtomicBool, Ordering}; 7use core::sync::atomic::{AtomicBool, Ordering};
8 8
9use defmt::*; 9use defmt::*;
10use embassy::channel::signal::Signal; 10use embassy_executor::executor::Spawner;
11use embassy::executor::Spawner;
12use embassy::time::Duration;
13use embassy::util::{select, Either};
14use embassy_nrf::gpio::{Input, Pin, Pull}; 11use embassy_nrf::gpio::{Input, Pin, Pull};
15use embassy_nrf::usb::{Driver, PowerUsb}; 12use embassy_nrf::usb::{Driver, PowerUsb};
16use embassy_nrf::{interrupt, pac, Peripherals}; 13use embassy_nrf::{interrupt, pac, Peripherals};
17use embassy_usb::control::OutResponse; 14use embassy_usb::control::OutResponse;
18use embassy_usb::{Builder, Config, DeviceStateHandler}; 15use embassy_usb::{Builder, Config, DeviceStateHandler};
19use embassy_usb_hid::{HidReaderWriter, ReportId, RequestHandler, State}; 16use embassy_usb_hid::{HidReaderWriter, ReportId, RequestHandler, State};
17use embassy_util::channel::signal::Signal;
18use embassy_util::{select, Either};
20use futures::future::join; 19use futures::future::join;
21use usbd_hid::descriptor::{KeyboardReport, SerializedDescriptor}; 20use usbd_hid::descriptor::{KeyboardReport, SerializedDescriptor};
22use {defmt_rtt as _, panic_probe as _}; 21use {defmt_rtt as _, panic_probe as _};
23 22
24static SUSPENDED: AtomicBool = AtomicBool::new(false); 23static SUSPENDED: AtomicBool = AtomicBool::new(false);
25 24
26#[embassy::main] 25#[embassy_executor::main]
27async fn main(_spawner: Spawner, p: Peripherals) { 26async fn main(_spawner: Spawner, p: Peripherals) {
28 let clock: pac::CLOCK = unsafe { mem::transmute(()) }; 27 let clock: pac::CLOCK = unsafe { mem::transmute(()) };
29 28
@@ -154,11 +153,11 @@ impl RequestHandler for MyRequestHandler {
154 OutResponse::Accepted 153 OutResponse::Accepted
155 } 154 }
156 155
157 fn set_idle(&self, id: Option<ReportId>, dur: Duration) { 156 fn set_idle_ms(&self, id: Option<ReportId>, dur: u32) {
158 info!("Set idle rate for {:?} to {:?}", id, dur); 157 info!("Set idle rate for {:?} to {:?}", id, dur);
159 } 158 }
160 159
161 fn get_idle(&self, id: Option<ReportId>) -> Option<Duration> { 160 fn get_idle_ms(&self, id: Option<ReportId>) -> Option<u32> {
162 info!("Get idle rate for {:?}", id); 161 info!("Get idle rate for {:?}", id);
163 None 162 None
164 } 163 }
diff --git a/examples/nrf/src/bin/usb_hid_mouse.rs b/examples/nrf/src/bin/usb_hid_mouse.rs
index 516e7ea95..88bf87bd6 100644
--- a/examples/nrf/src/bin/usb_hid_mouse.rs
+++ b/examples/nrf/src/bin/usb_hid_mouse.rs
@@ -6,8 +6,8 @@
6use core::mem; 6use core::mem;
7 7
8use defmt::*; 8use defmt::*;
9use embassy::executor::Spawner; 9use embassy_executor::executor::Spawner;
10use embassy::time::{Duration, Timer}; 10use embassy_executor::time::{Duration, Timer};
11use embassy_nrf::usb::{Driver, PowerUsb}; 11use embassy_nrf::usb::{Driver, PowerUsb};
12use embassy_nrf::{interrupt, pac, Peripherals}; 12use embassy_nrf::{interrupt, pac, Peripherals};
13use embassy_usb::control::OutResponse; 13use embassy_usb::control::OutResponse;
@@ -17,7 +17,7 @@ use futures::future::join;
17use usbd_hid::descriptor::{MouseReport, SerializedDescriptor}; 17use usbd_hid::descriptor::{MouseReport, SerializedDescriptor};
18use {defmt_rtt as _, panic_probe as _}; 18use {defmt_rtt as _, panic_probe as _};
19 19
20#[embassy::main] 20#[embassy_executor::main]
21async fn main(_spawner: Spawner, p: Peripherals) { 21async fn main(_spawner: Spawner, p: Peripherals) {
22 let clock: pac::CLOCK = unsafe { mem::transmute(()) }; 22 let clock: pac::CLOCK = unsafe { mem::transmute(()) };
23 23
@@ -113,11 +113,11 @@ impl RequestHandler for MyRequestHandler {
113 OutResponse::Accepted 113 OutResponse::Accepted
114 } 114 }
115 115
116 fn set_idle(&self, id: Option<ReportId>, dur: Duration) { 116 fn set_idle_ms(&self, id: Option<ReportId>, dur: u32) {
117 info!("Set idle rate for {:?} to {:?}", id, dur); 117 info!("Set idle rate for {:?} to {:?}", id, dur);
118 } 118 }
119 119
120 fn get_idle(&self, id: Option<ReportId>) -> Option<Duration> { 120 fn get_idle_ms(&self, id: Option<ReportId>) -> Option<u32> {
121 info!("Get idle rate for {:?}", id); 121 info!("Get idle rate for {:?}", id);
122 None 122 None
123 } 123 }
diff --git a/examples/nrf/src/bin/usb_serial.rs b/examples/nrf/src/bin/usb_serial.rs
index d2200dc5d..7d233d24d 100644
--- a/examples/nrf/src/bin/usb_serial.rs
+++ b/examples/nrf/src/bin/usb_serial.rs
@@ -6,7 +6,7 @@
6use core::mem; 6use core::mem;
7 7
8use defmt::{info, panic}; 8use defmt::{info, panic};
9use embassy::executor::Spawner; 9use embassy_executor::executor::Spawner;
10use embassy_nrf::usb::{Driver, Instance, PowerUsb, UsbSupply}; 10use embassy_nrf::usb::{Driver, Instance, PowerUsb, UsbSupply};
11use embassy_nrf::{interrupt, pac, Peripherals}; 11use embassy_nrf::{interrupt, pac, Peripherals};
12use embassy_usb::driver::EndpointError; 12use embassy_usb::driver::EndpointError;
@@ -15,7 +15,7 @@ use embassy_usb_serial::{CdcAcmClass, State};
15use futures::future::join; 15use futures::future::join;
16use {defmt_rtt as _, panic_probe as _}; 16use {defmt_rtt as _, panic_probe as _};
17 17
18#[embassy::main] 18#[embassy_executor::main]
19async fn main(_spawner: Spawner, p: Peripherals) { 19async fn main(_spawner: Spawner, p: Peripherals) {
20 let clock: pac::CLOCK = unsafe { mem::transmute(()) }; 20 let clock: pac::CLOCK = unsafe { mem::transmute(()) };
21 21
diff --git a/examples/nrf/src/bin/usb_serial_multitask.rs b/examples/nrf/src/bin/usb_serial_multitask.rs
index 3806da5a0..956315322 100644
--- a/examples/nrf/src/bin/usb_serial_multitask.rs
+++ b/examples/nrf/src/bin/usb_serial_multitask.rs
@@ -6,23 +6,23 @@
6use core::mem; 6use core::mem;
7 7
8use defmt::{info, panic, unwrap}; 8use defmt::{info, panic, unwrap};
9use embassy::executor::Spawner; 9use embassy_executor::executor::Spawner;
10use embassy::util::Forever;
11use embassy_nrf::usb::{Driver, PowerUsb}; 10use embassy_nrf::usb::{Driver, PowerUsb};
12use embassy_nrf::{interrupt, pac, peripherals, Peripherals}; 11use embassy_nrf::{interrupt, pac, peripherals, Peripherals};
13use embassy_usb::driver::EndpointError; 12use embassy_usb::driver::EndpointError;
14use embassy_usb::{Builder, Config, UsbDevice}; 13use embassy_usb::{Builder, Config, UsbDevice};
15use embassy_usb_serial::{CdcAcmClass, State}; 14use embassy_usb_serial::{CdcAcmClass, State};
15use embassy_util::Forever;
16use {defmt_rtt as _, panic_probe as _}; 16use {defmt_rtt as _, panic_probe as _};
17 17
18type MyDriver = Driver<'static, peripherals::USBD, PowerUsb>; 18type MyDriver = Driver<'static, peripherals::USBD, PowerUsb>;
19 19
20#[embassy::task] 20#[embassy_executor::task]
21async fn usb_task(mut device: UsbDevice<'static, MyDriver>) { 21async fn usb_task(mut device: UsbDevice<'static, MyDriver>) {
22 device.run().await; 22 device.run().await;
23} 23}
24 24
25#[embassy::task] 25#[embassy_executor::task]
26async fn echo_task(mut class: CdcAcmClass<'static, MyDriver>) { 26async fn echo_task(mut class: CdcAcmClass<'static, MyDriver>) {
27 loop { 27 loop {
28 class.wait_connection().await; 28 class.wait_connection().await;
@@ -32,7 +32,7 @@ async fn echo_task(mut class: CdcAcmClass<'static, MyDriver>) {
32 } 32 }
33} 33}
34 34
35#[embassy::main] 35#[embassy_executor::main]
36async fn main(spawner: Spawner, p: Peripherals) { 36async fn main(spawner: Spawner, p: Peripherals) {
37 let clock: pac::CLOCK = unsafe { mem::transmute(()) }; 37 let clock: pac::CLOCK = unsafe { mem::transmute(()) };
38 38
diff --git a/examples/nrf/src/bin/wdt.rs b/examples/nrf/src/bin/wdt.rs
index 280e23bcf..560cb3567 100644
--- a/examples/nrf/src/bin/wdt.rs
+++ b/examples/nrf/src/bin/wdt.rs
@@ -3,13 +3,13 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::*; 5use defmt::*;
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy_nrf::gpio::{Input, Pull}; 7use embassy_nrf::gpio::{Input, Pull};
8use embassy_nrf::wdt::{Config, Watchdog}; 8use embassy_nrf::wdt::{Config, Watchdog};
9use embassy_nrf::Peripherals; 9use embassy_nrf::Peripherals;
10use {defmt_rtt as _, panic_probe as _}; 10use {defmt_rtt as _, panic_probe as _};
11 11
12#[embassy::main] 12#[embassy_executor::main]
13async fn main(_spawner: Spawner, p: Peripherals) { 13async fn main(_spawner: Spawner, p: Peripherals) {
14 info!("Hello World!"); 14 info!("Hello World!");
15 15
diff --git a/examples/rp/Cargo.toml b/examples/rp/Cargo.toml
index d0704f203..94c3d8013 100644
--- a/examples/rp/Cargo.toml
+++ b/examples/rp/Cargo.toml
@@ -5,7 +5,8 @@ version = "0.1.0"
5 5
6 6
7[dependencies] 7[dependencies]
8embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt", "defmt-timestamp-uptime"] } 8embassy-util = { version = "0.1.0", path = "../../embassy-util", features = ["defmt"] }
9embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "defmt-timestamp-uptime"] }
9embassy-rp = { version = "0.1.0", path = "../../embassy-rp", features = ["defmt", "unstable-traits", "nightly", "unstable-pac"] } 10embassy-rp = { version = "0.1.0", path = "../../embassy-rp", features = ["defmt", "unstable-traits", "nightly", "unstable-pac"] }
10atomic-polyfill = "0.1.5" 11atomic-polyfill = "0.1.5"
11 12
diff --git a/examples/rp/src/bin/blinky.rs b/examples/rp/src/bin/blinky.rs
index 35612a4cf..e53fca1af 100644
--- a/examples/rp/src/bin/blinky.rs
+++ b/examples/rp/src/bin/blinky.rs
@@ -3,13 +3,13 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::*; 5use defmt::*;
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy::time::{Duration, Timer}; 7use embassy_executor::time::{Duration, Timer};
8use embassy_rp::{gpio, Peripherals}; 8use embassy_rp::{gpio, Peripherals};
9use gpio::{Level, Output}; 9use gpio::{Level, Output};
10use {defmt_rtt as _, panic_probe as _}; 10use {defmt_rtt as _, panic_probe as _};
11 11
12#[embassy::main] 12#[embassy_executor::main]
13async fn main(_spawner: Spawner, p: Peripherals) { 13async fn main(_spawner: Spawner, p: Peripherals) {
14 let mut led = Output::new(p.PIN_25, Level::Low); 14 let mut led = Output::new(p.PIN_25, Level::Low);
15 15
diff --git a/examples/rp/src/bin/button.rs b/examples/rp/src/bin/button.rs
index 980e54ea1..02cbc9416 100644
--- a/examples/rp/src/bin/button.rs
+++ b/examples/rp/src/bin/button.rs
@@ -2,12 +2,12 @@
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use embassy::executor::Spawner; 5use embassy_executor::executor::Spawner;
6use embassy_rp::gpio::{Input, Level, Output, Pull}; 6use embassy_rp::gpio::{Input, Level, Output, Pull};
7use embassy_rp::Peripherals; 7use embassy_rp::Peripherals;
8use {defmt_rtt as _, panic_probe as _}; 8use {defmt_rtt as _, panic_probe as _};
9 9
10#[embassy::main] 10#[embassy_executor::main]
11async fn main(_spawner: Spawner, p: Peripherals) { 11async fn main(_spawner: Spawner, p: Peripherals) {
12 let button = Input::new(p.PIN_28, Pull::Up); 12 let button = Input::new(p.PIN_28, Pull::Up);
13 let mut led = Output::new(p.PIN_25, Level::Low); 13 let mut led = Output::new(p.PIN_25, Level::Low);
diff --git a/examples/rp/src/bin/gpio_async.rs b/examples/rp/src/bin/gpio_async.rs
index e0f2aa961..ba905b015 100644
--- a/examples/rp/src/bin/gpio_async.rs
+++ b/examples/rp/src/bin/gpio_async.rs
@@ -3,8 +3,8 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::*; 5use defmt::*;
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy::time::{Duration, Timer}; 7use embassy_executor::time::{Duration, Timer};
8use embassy_rp::{gpio, Peripherals}; 8use embassy_rp::{gpio, Peripherals};
9use gpio::{Input, Level, Output, Pull}; 9use gpio::{Input, Level, Output, Pull};
10use {defmt_rtt as _, panic_probe as _}; 10use {defmt_rtt as _, panic_probe as _};
@@ -19,7 +19,7 @@ use {defmt_rtt as _, panic_probe as _};
19/// high signal on PIN 16. Once the high event/signal occurs the program will 19/// high signal on PIN 16. Once the high event/signal occurs the program will
20/// continue and turn off the LED, and then wait for 2 seconds before completing 20/// continue and turn off the LED, and then wait for 2 seconds before completing
21/// the loop and starting over again. 21/// the loop and starting over again.
22#[embassy::main] 22#[embassy_executor::main]
23async fn main(_spawner: Spawner, p: Peripherals) { 23async fn main(_spawner: Spawner, p: Peripherals) {
24 let mut led = Output::new(p.PIN_25, Level::Low); 24 let mut led = Output::new(p.PIN_25, Level::Low);
25 let mut async_input = Input::new(p.PIN_16, Pull::None); 25 let mut async_input = Input::new(p.PIN_16, Pull::None);
diff --git a/examples/rp/src/bin/spi.rs b/examples/rp/src/bin/spi.rs
index d97aa94b3..a3160c106 100644
--- a/examples/rp/src/bin/spi.rs
+++ b/examples/rp/src/bin/spi.rs
@@ -3,13 +3,13 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::*; 5use defmt::*;
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy_rp::spi::Spi; 7use embassy_rp::spi::Spi;
8use embassy_rp::{gpio, spi, Peripherals}; 8use embassy_rp::{gpio, spi, Peripherals};
9use gpio::{Level, Output}; 9use gpio::{Level, Output};
10use {defmt_rtt as _, panic_probe as _}; 10use {defmt_rtt as _, panic_probe as _};
11 11
12#[embassy::main] 12#[embassy_executor::main]
13async fn main(_spawner: Spawner, p: Peripherals) { 13async fn main(_spawner: Spawner, p: Peripherals) {
14 info!("Hello World!"); 14 info!("Hello World!");
15 15
diff --git a/examples/rp/src/bin/spi_display.rs b/examples/rp/src/bin/spi_display.rs
index f4a411ba6..2760b23fa 100644
--- a/examples/rp/src/bin/spi_display.rs
+++ b/examples/rp/src/bin/spi_display.rs
@@ -5,8 +5,8 @@
5use core::cell::RefCell; 5use core::cell::RefCell;
6 6
7use defmt::*; 7use defmt::*;
8use embassy::executor::Spawner; 8use embassy_executor::executor::Spawner;
9use embassy::time::Delay; 9use embassy_executor::time::Delay;
10use embassy_rp::gpio::{Level, Output}; 10use embassy_rp::gpio::{Level, Output};
11use embassy_rp::spi::Spi; 11use embassy_rp::spi::Spi;
12use embassy_rp::{spi, Peripherals}; 12use embassy_rp::{spi, Peripherals};
@@ -27,7 +27,7 @@ use crate::touch::Touch;
27//const DISPLAY_FREQ: u32 = 64_000_000; 27//const DISPLAY_FREQ: u32 = 64_000_000;
28const TOUCH_FREQ: u32 = 200_000; 28const TOUCH_FREQ: u32 = 200_000;
29 29
30#[embassy::main] 30#[embassy_executor::main]
31async fn main(_spawner: Spawner, p: Peripherals) { 31async fn main(_spawner: Spawner, p: Peripherals) {
32 info!("Hello World!"); 32 info!("Hello World!");
33 33
diff --git a/examples/rp/src/bin/uart.rs b/examples/rp/src/bin/uart.rs
index 99072253a..0d2954894 100644
--- a/examples/rp/src/bin/uart.rs
+++ b/examples/rp/src/bin/uart.rs
@@ -2,11 +2,11 @@
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use embassy::executor::Spawner; 5use embassy_executor::executor::Spawner;
6use embassy_rp::{uart, Peripherals}; 6use embassy_rp::{uart, Peripherals};
7use {defmt_rtt as _, panic_probe as _}; 7use {defmt_rtt as _, panic_probe as _};
8 8
9#[embassy::main] 9#[embassy_executor::main]
10async fn main(_spawner: Spawner, p: Peripherals) { 10async fn main(_spawner: Spawner, p: Peripherals) {
11 let config = uart::Config::default(); 11 let config = uart::Config::default();
12 let mut uart = uart::Uart::new(p.UART0, p.PIN_0, p.PIN_1, p.PIN_2, p.PIN_3, config); 12 let mut uart = uart::Uart::new(p.UART0, p.PIN_0, p.PIN_1, p.PIN_2, p.PIN_3, config);
diff --git a/examples/std/Cargo.toml b/examples/std/Cargo.toml
index 8787f3c92..54499796b 100644
--- a/examples/std/Cargo.toml
+++ b/examples/std/Cargo.toml
@@ -4,7 +4,8 @@ name = "embassy-std-examples"
4version = "0.1.0" 4version = "0.1.0"
5 5
6[dependencies] 6[dependencies]
7embassy = { version = "0.1.0", path = "../../embassy", features = ["log", "std", "time", "nightly"] } 7embassy-util = { version = "0.1.0", path = "../../embassy-util", features = ["log"] }
8embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["log", "std", "time", "nightly"] }
8embassy-net = { version = "0.1.0", path = "../../embassy-net", features=[ "std", "log", "medium-ethernet", "tcp", "dhcpv4", "pool-16"] } 9embassy-net = { version = "0.1.0", path = "../../embassy-net", features=[ "std", "log", "medium-ethernet", "tcp", "dhcpv4", "pool-16"] }
9embedded-io = { version = "0.3.0", features = ["async", "std", "futures"] } 10embedded-io = { version = "0.3.0", features = ["async", "std", "futures"] }
10 11
diff --git a/examples/std/src/bin/net.rs b/examples/std/src/bin/net.rs
index 74073ee81..202585289 100644
--- a/examples/std/src/bin/net.rs
+++ b/examples/std/src/bin/net.rs
@@ -1,10 +1,10 @@
1#![feature(type_alias_impl_trait)] 1#![feature(type_alias_impl_trait)]
2 2
3use clap::Parser; 3use clap::Parser;
4use embassy::executor::{Executor, Spawner}; 4use embassy_executor::executor::{Executor, Spawner};
5use embassy::util::Forever;
6use embassy_net::tcp::TcpSocket; 5use embassy_net::tcp::TcpSocket;
7use embassy_net::{ConfigStrategy, Ipv4Address, Ipv4Cidr, Stack, StackResources}; 6use embassy_net::{ConfigStrategy, Ipv4Address, Ipv4Cidr, Stack, StackResources};
7use embassy_util::Forever;
8use embedded_io::asynch::Write; 8use embedded_io::asynch::Write;
9use heapless::Vec; 9use heapless::Vec;
10use log::*; 10use log::*;
@@ -34,12 +34,12 @@ struct Opts {
34 static_ip: bool, 34 static_ip: bool,
35} 35}
36 36
37#[embassy::task] 37#[embassy_executor::task]
38async fn net_task(stack: &'static Stack<TunTapDevice>) -> ! { 38async fn net_task(stack: &'static Stack<TunTapDevice>) -> ! {
39 stack.run().await 39 stack.run().await
40} 40}
41 41
42#[embassy::task] 42#[embassy_executor::task]
43async fn main_task(spawner: Spawner) { 43async fn main_task(spawner: Spawner) {
44 let opts: Opts = Opts::parse(); 44 let opts: Opts = Opts::parse();
45 45
diff --git a/examples/std/src/bin/serial.rs b/examples/std/src/bin/serial.rs
index b1e5b0142..b803d1ef7 100644
--- a/examples/std/src/bin/serial.rs
+++ b/examples/std/src/bin/serial.rs
@@ -4,15 +4,15 @@
4mod serial_port; 4mod serial_port;
5 5
6use async_io::Async; 6use async_io::Async;
7use embassy::executor::Executor; 7use embassy_executor::executor::Executor;
8use embassy::util::Forever; 8use embassy_util::Forever;
9use embedded_io::asynch::Read; 9use embedded_io::asynch::Read;
10use log::*; 10use log::*;
11use nix::sys::termios; 11use nix::sys::termios;
12 12
13use self::serial_port::SerialPort; 13use self::serial_port::SerialPort;
14 14
15#[embassy::task] 15#[embassy_executor::task]
16async fn run() { 16async fn run() {
17 // Open the serial port. 17 // Open the serial port.
18 let baudrate = termios::BaudRate::B115200; 18 let baudrate = termios::BaudRate::B115200;
diff --git a/examples/std/src/bin/tick.rs b/examples/std/src/bin/tick.rs
index bed9d7dc5..9ca900df8 100644
--- a/examples/std/src/bin/tick.rs
+++ b/examples/std/src/bin/tick.rs
@@ -1,10 +1,10 @@
1#![feature(type_alias_impl_trait)] 1#![feature(type_alias_impl_trait)]
2 2
3use embassy::executor::Spawner; 3use embassy_executor::executor::Spawner;
4use embassy::time::{Duration, Timer}; 4use embassy_executor::time::{Duration, Timer};
5use log::*; 5use log::*;
6 6
7#[embassy::task] 7#[embassy_executor::task]
8async fn run() { 8async fn run() {
9 loop { 9 loop {
10 info!("tick"); 10 info!("tick");
@@ -12,7 +12,7 @@ async fn run() {
12 } 12 }
13} 13}
14 14
15#[embassy::main] 15#[embassy_executor::main]
16async fn main(spawner: Spawner) { 16async fn main(spawner: Spawner) {
17 env_logger::builder() 17 env_logger::builder()
18 .filter_level(log::LevelFilter::Debug) 18 .filter_level(log::LevelFilter::Debug)
diff --git a/examples/stm32f0/Cargo.toml b/examples/stm32f0/Cargo.toml
index 615803258..3ba297636 100644
--- a/examples/stm32f0/Cargo.toml
+++ b/examples/stm32f0/Cargo.toml
@@ -11,6 +11,7 @@ cortex-m-rt = "0.7.0"
11defmt = "0.3" 11defmt = "0.3"
12defmt-rtt = "0.3" 12defmt-rtt = "0.3"
13panic-probe = "0.3" 13panic-probe = "0.3"
14embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt", "defmt-timestamp-uptime", "time-tick-32768hz"] } 14embassy-util = { version = "0.1.0", path = "../../embassy-util", features = ["defmt"] }
15embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "defmt-timestamp-uptime", "time-tick-32768hz"] }
15embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "memory-x", "stm32f030f4", "time-driver-any"] } 16embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "memory-x", "stm32f030f4", "time-driver-any"] }
16 17
diff --git a/examples/stm32f0/src/bin/hello.rs b/examples/stm32f0/src/bin/hello.rs
index 225f1c3ae..c9081ea12 100644
--- a/examples/stm32f0/src/bin/hello.rs
+++ b/examples/stm32f0/src/bin/hello.rs
@@ -3,12 +3,12 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::info; 5use defmt::info;
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy::time::{Duration, Timer}; 7use embassy_executor::time::{Duration, Timer};
8use embassy_stm32::Peripherals; 8use embassy_stm32::Peripherals;
9use {defmt_rtt as _, panic_probe as _}; 9use {defmt_rtt as _, panic_probe as _};
10 10
11#[embassy::main] 11#[embassy_executor::main]
12async fn main(_spawner: Spawner, _p: Peripherals) -> ! { 12async fn main(_spawner: Spawner, _p: Peripherals) -> ! {
13 loop { 13 loop {
14 Timer::after(Duration::from_secs(1)).await; 14 Timer::after(Duration::from_secs(1)).await;
diff --git a/examples/stm32f1/Cargo.toml b/examples/stm32f1/Cargo.toml
index fb0e605d6..9ce553b6d 100644
--- a/examples/stm32f1/Cargo.toml
+++ b/examples/stm32f1/Cargo.toml
@@ -4,7 +4,8 @@ name = "embassy-stm32f1-examples"
4version = "0.1.0" 4version = "0.1.0"
5 5
6[dependencies] 6[dependencies]
7embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt", "defmt-timestamp-uptime", "time-tick-32768hz"] } 7embassy-util = { version = "0.1.0", path = "../../embassy-util", features = ["defmt"] }
8embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "defmt-timestamp-uptime", "time-tick-32768hz"] }
8embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32f103c8", "unstable-pac", "memory-x", "time-driver-any"] } 9embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32f103c8", "unstable-pac", "memory-x", "time-driver-any"] }
9embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } 10embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] }
10embassy-usb-serial = { version = "0.1.0", path = "../../embassy-usb-serial", features = ["defmt"] } 11embassy-usb-serial = { version = "0.1.0", path = "../../embassy-usb-serial", features = ["defmt"] }
diff --git a/examples/stm32f1/src/bin/adc.rs b/examples/stm32f1/src/bin/adc.rs
index 09904d4cc..e54593fe5 100644
--- a/examples/stm32f1/src/bin/adc.rs
+++ b/examples/stm32f1/src/bin/adc.rs
@@ -3,13 +3,13 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::*; 5use defmt::*;
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy::time::{Delay, Duration, Timer}; 7use embassy_executor::time::{Delay, Duration, Timer};
8use embassy_stm32::adc::Adc; 8use embassy_stm32::adc::Adc;
9use embassy_stm32::Peripherals; 9use embassy_stm32::Peripherals;
10use {defmt_rtt as _, panic_probe as _}; 10use {defmt_rtt as _, panic_probe as _};
11 11
12#[embassy::main] 12#[embassy_executor::main]
13async fn main(_spawner: Spawner, p: Peripherals) { 13async fn main(_spawner: Spawner, p: Peripherals) {
14 info!("Hello World!"); 14 info!("Hello World!");
15 15
diff --git a/examples/stm32f1/src/bin/blinky.rs b/examples/stm32f1/src/bin/blinky.rs
index c98d0cdad..5171043e8 100644
--- a/examples/stm32f1/src/bin/blinky.rs
+++ b/examples/stm32f1/src/bin/blinky.rs
@@ -3,13 +3,13 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::*; 5use defmt::*;
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy::time::{Duration, Timer}; 7use embassy_executor::time::{Duration, Timer};
8use embassy_stm32::gpio::{Level, Output, Speed}; 8use embassy_stm32::gpio::{Level, Output, Speed};
9use embassy_stm32::Peripherals; 9use embassy_stm32::Peripherals;
10use {defmt_rtt as _, panic_probe as _}; 10use {defmt_rtt as _, panic_probe as _};
11 11
12#[embassy::main] 12#[embassy_executor::main]
13async fn main(_spawner: Spawner, p: Peripherals) { 13async fn main(_spawner: Spawner, p: Peripherals) {
14 info!("Hello World!"); 14 info!("Hello World!");
15 15
diff --git a/examples/stm32f1/src/bin/hello.rs b/examples/stm32f1/src/bin/hello.rs
index 82f11bc28..549d1bfba 100644
--- a/examples/stm32f1/src/bin/hello.rs
+++ b/examples/stm32f1/src/bin/hello.rs
@@ -3,8 +3,8 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::info; 5use defmt::info;
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy::time::{Duration, Timer}; 7use embassy_executor::time::{Duration, Timer};
8use embassy_stm32::time::Hertz; 8use embassy_stm32::time::Hertz;
9use embassy_stm32::{Config, Peripherals}; 9use embassy_stm32::{Config, Peripherals};
10use {defmt_rtt as _, panic_probe as _}; 10use {defmt_rtt as _, panic_probe as _};
@@ -15,7 +15,7 @@ fn config() -> Config {
15 config 15 config
16} 16}
17 17
18#[embassy::main(config = "config()")] 18#[embassy_executor::main(config = "config()")]
19async fn main(_spawner: Spawner, _p: Peripherals) -> ! { 19async fn main(_spawner: Spawner, _p: Peripherals) -> ! {
20 loop { 20 loop {
21 info!("Hello World!"); 21 info!("Hello World!");
diff --git a/examples/stm32f1/src/bin/usb_serial.rs b/examples/stm32f1/src/bin/usb_serial.rs
index d06315d76..cf7facb79 100644
--- a/examples/stm32f1/src/bin/usb_serial.rs
+++ b/examples/stm32f1/src/bin/usb_serial.rs
@@ -3,8 +3,8 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::{panic, *}; 5use defmt::{panic, *};
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy::time::{Duration, Timer}; 7use embassy_executor::time::{Duration, Timer};
8use embassy_stm32::gpio::{Level, Output, Speed}; 8use embassy_stm32::gpio::{Level, Output, Speed};
9use embassy_stm32::time::Hertz; 9use embassy_stm32::time::Hertz;
10use embassy_stm32::usb::{Driver, Instance}; 10use embassy_stm32::usb::{Driver, Instance};
@@ -23,7 +23,7 @@ fn config() -> Config {
23 config 23 config
24} 24}
25 25
26#[embassy::main(config = "config()")] 26#[embassy_executor::main(config = "config()")]
27async fn main(_spawner: Spawner, mut p: Peripherals) { 27async fn main(_spawner: Spawner, mut p: Peripherals) {
28 info!("Hello World!"); 28 info!("Hello World!");
29 29
diff --git a/examples/stm32f2/Cargo.toml b/examples/stm32f2/Cargo.toml
index 6ea6add17..a3fb736da 100644
--- a/examples/stm32f2/Cargo.toml
+++ b/examples/stm32f2/Cargo.toml
@@ -4,7 +4,8 @@ name = "embassy-stm32f2-examples"
4version = "0.1.0" 4version = "0.1.0"
5 5
6[dependencies] 6[dependencies]
7embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt", "defmt-timestamp-uptime", "time-tick-32768hz"] } 7embassy-util = { version = "0.1.0", path = "../../embassy-util", features = ["defmt"] }
8embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "defmt-timestamp-uptime", "time-tick-32768hz"] }
8embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32f207zg", "unstable-pac", "memory-x", "time-driver-any", "exti"] } 9embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32f207zg", "unstable-pac", "memory-x", "time-driver-any", "exti"] }
9 10
10defmt = "0.3" 11defmt = "0.3"
diff --git a/examples/stm32f2/src/bin/blinky.rs b/examples/stm32f2/src/bin/blinky.rs
index dd20ba85a..48ae2e711 100644
--- a/examples/stm32f2/src/bin/blinky.rs
+++ b/examples/stm32f2/src/bin/blinky.rs
@@ -3,13 +3,13 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::*; 5use defmt::*;
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy::time::{Duration, Timer}; 7use embassy_executor::time::{Duration, Timer};
8use embassy_stm32::gpio::{Level, Output, Speed}; 8use embassy_stm32::gpio::{Level, Output, Speed};
9use embassy_stm32::Peripherals; 9use embassy_stm32::Peripherals;
10use {defmt_rtt as _, panic_probe as _}; 10use {defmt_rtt as _, panic_probe as _};
11 11
12#[embassy::main] 12#[embassy_executor::main]
13async fn main(_spawner: Spawner, p: Peripherals) { 13async fn main(_spawner: Spawner, p: Peripherals) {
14 info!("Hello World!"); 14 info!("Hello World!");
15 15
diff --git a/examples/stm32f2/src/bin/pll.rs b/examples/stm32f2/src/bin/pll.rs
index b09d64b0b..01e63b15e 100644
--- a/examples/stm32f2/src/bin/pll.rs
+++ b/examples/stm32f2/src/bin/pll.rs
@@ -5,8 +5,8 @@
5use core::convert::TryFrom; 5use core::convert::TryFrom;
6 6
7use defmt::*; 7use defmt::*;
8use embassy::executor::Spawner; 8use embassy_executor::executor::Spawner;
9use embassy::time::{Duration, Timer}; 9use embassy_executor::time::{Duration, Timer};
10use embassy_stm32::rcc::{ 10use embassy_stm32::rcc::{
11 APBPrescaler, ClockSrc, HSEConfig, HSESrc, PLL48Div, PLLConfig, PLLMainDiv, PLLMul, PLLPreDiv, PLLSrc, 11 APBPrescaler, ClockSrc, HSEConfig, HSESrc, PLL48Div, PLLConfig, PLLMainDiv, PLLMul, PLLPreDiv, PLLSrc,
12}; 12};
@@ -43,7 +43,7 @@ fn config() -> Config {
43 config 43 config
44} 44}
45 45
46#[embassy::main(config = "config()")] 46#[embassy_executor::main(config = "config()")]
47async fn main(_spawner: Spawner, _p: Peripherals) { 47async fn main(_spawner: Spawner, _p: Peripherals) {
48 loop { 48 loop {
49 Timer::after(Duration::from_millis(1000)).await; 49 Timer::after(Duration::from_millis(1000)).await;
diff --git a/examples/stm32f3/Cargo.toml b/examples/stm32f3/Cargo.toml
index 6912ba765..410e9b3e0 100644
--- a/examples/stm32f3/Cargo.toml
+++ b/examples/stm32f3/Cargo.toml
@@ -4,7 +4,8 @@ name = "embassy-stm32f3-examples"
4version = "0.1.0" 4version = "0.1.0"
5 5
6[dependencies] 6[dependencies]
7embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt", "defmt-timestamp-uptime", "time-tick-32768hz"] } 7embassy-util = { version = "0.1.0", path = "../../embassy-util", features = ["defmt"] }
8embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "defmt-timestamp-uptime", "time-tick-32768hz"] }
8embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32f303ze", "unstable-pac", "memory-x", "time-driver-any", "exti"] } 9embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32f303ze", "unstable-pac", "memory-x", "time-driver-any", "exti"] }
9embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } 10embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] }
10embassy-usb-serial = { version = "0.1.0", path = "../../embassy-usb-serial", features = ["defmt"] } 11embassy-usb-serial = { version = "0.1.0", path = "../../embassy-usb-serial", features = ["defmt"] }
diff --git a/examples/stm32f3/src/bin/blinky.rs b/examples/stm32f3/src/bin/blinky.rs
index 4d0b33f61..7146eaa54 100644
--- a/examples/stm32f3/src/bin/blinky.rs
+++ b/examples/stm32f3/src/bin/blinky.rs
@@ -3,13 +3,13 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::*; 5use defmt::*;
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy::time::{Duration, Timer}; 7use embassy_executor::time::{Duration, Timer};
8use embassy_stm32::gpio::{Level, Output, Speed}; 8use embassy_stm32::gpio::{Level, Output, Speed};
9use embassy_stm32::Peripherals; 9use embassy_stm32::Peripherals;
10use {defmt_rtt as _, panic_probe as _}; 10use {defmt_rtt as _, panic_probe as _};
11 11
12#[embassy::main] 12#[embassy_executor::main]
13async fn main(_spawner: Spawner, p: Peripherals) { 13async fn main(_spawner: Spawner, p: Peripherals) {
14 info!("Hello World!"); 14 info!("Hello World!");
15 15
diff --git a/examples/stm32f3/src/bin/button_events.rs b/examples/stm32f3/src/bin/button_events.rs
index 45862ddc6..ef5110316 100644
--- a/examples/stm32f3/src/bin/button_events.rs
+++ b/examples/stm32f3/src/bin/button_events.rs
@@ -11,14 +11,14 @@
11#![feature(type_alias_impl_trait)] 11#![feature(type_alias_impl_trait)]
12 12
13use defmt::*; 13use defmt::*;
14use embassy::blocking_mutex::raw::ThreadModeRawMutex; 14use embassy_executor::executor::Spawner;
15use embassy::channel::mpmc::Channel; 15use embassy_executor::time::{with_timeout, Duration, Timer};
16use embassy::executor::Spawner;
17use embassy::time::{with_timeout, Duration, Timer};
18use embassy_stm32::exti::ExtiInput; 16use embassy_stm32::exti::ExtiInput;
19use embassy_stm32::gpio::{AnyPin, Input, Level, Output, Pin, Pull, Speed}; 17use embassy_stm32::gpio::{AnyPin, Input, Level, Output, Pin, Pull, Speed};
20use embassy_stm32::peripherals::PA0; 18use embassy_stm32::peripherals::PA0;
21use embassy_stm32::Peripherals; 19use embassy_stm32::Peripherals;
20use embassy_util::blocking_mutex::raw::ThreadModeRawMutex;
21use embassy_util::channel::mpmc::Channel;
22use {defmt_rtt as _, panic_probe as _}; 22use {defmt_rtt as _, panic_probe as _};
23 23
24struct Leds<'a> { 24struct Leds<'a> {
@@ -99,7 +99,7 @@ enum ButtonEvent {
99 99
100static CHANNEL: Channel<ThreadModeRawMutex, ButtonEvent, 4> = Channel::new(); 100static CHANNEL: Channel<ThreadModeRawMutex, ButtonEvent, 4> = Channel::new();
101 101
102#[embassy::main] 102#[embassy_executor::main]
103async fn main(spawner: Spawner, p: Peripherals) { 103async fn main(spawner: Spawner, p: Peripherals) {
104 let button = Input::new(p.PA0, Pull::Down); 104 let button = Input::new(p.PA0, Pull::Down);
105 let button = ExtiInput::new(button, p.EXTI0); 105 let button = ExtiInput::new(button, p.EXTI0);
@@ -120,14 +120,14 @@ async fn main(spawner: Spawner, p: Peripherals) {
120 spawner.spawn(led_blinker(leds)).unwrap(); 120 spawner.spawn(led_blinker(leds)).unwrap();
121} 121}
122 122
123#[embassy::task] 123#[embassy_executor::task]
124async fn led_blinker(mut leds: Leds<'static>) { 124async fn led_blinker(mut leds: Leds<'static>) {
125 loop { 125 loop {
126 leds.show().await; 126 leds.show().await;
127 } 127 }
128} 128}
129 129
130#[embassy::task] 130#[embassy_executor::task]
131async fn button_waiter(mut button: ExtiInput<'static, PA0>) { 131async fn button_waiter(mut button: ExtiInput<'static, PA0>) {
132 const DOUBLE_CLICK_DELAY: u64 = 250; 132 const DOUBLE_CLICK_DELAY: u64 = 250;
133 const HOLD_DELAY: u64 = 1000; 133 const HOLD_DELAY: u64 = 1000;
diff --git a/examples/stm32f3/src/bin/button_exti.rs b/examples/stm32f3/src/bin/button_exti.rs
index add6712b4..dee06e5de 100644
--- a/examples/stm32f3/src/bin/button_exti.rs
+++ b/examples/stm32f3/src/bin/button_exti.rs
@@ -3,13 +3,13 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::*; 5use defmt::*;
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy_stm32::exti::ExtiInput; 7use embassy_stm32::exti::ExtiInput;
8use embassy_stm32::gpio::{Input, Pull}; 8use embassy_stm32::gpio::{Input, Pull};
9use embassy_stm32::Peripherals; 9use embassy_stm32::Peripherals;
10use {defmt_rtt as _, panic_probe as _}; 10use {defmt_rtt as _, panic_probe as _};
11 11
12#[embassy::main] 12#[embassy_executor::main]
13async fn main(_spawner: Spawner, p: Peripherals) { 13async fn main(_spawner: Spawner, p: Peripherals) {
14 info!("Hello World!"); 14 info!("Hello World!");
15 15
diff --git a/examples/stm32f3/src/bin/flash.rs b/examples/stm32f3/src/bin/flash.rs
index ce16f6de7..be2f6f671 100644
--- a/examples/stm32f3/src/bin/flash.rs
+++ b/examples/stm32f3/src/bin/flash.rs
@@ -3,13 +3,13 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::{info, unwrap}; 5use defmt::{info, unwrap};
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy_stm32::flash::Flash; 7use embassy_stm32::flash::Flash;
8use embassy_stm32::Peripherals; 8use embassy_stm32::Peripherals;
9use embedded_storage::nor_flash::{NorFlash, ReadNorFlash}; 9use embedded_storage::nor_flash::{NorFlash, ReadNorFlash};
10use {defmt_rtt as _, panic_probe as _}; 10use {defmt_rtt as _, panic_probe as _};
11 11
12#[embassy::main] 12#[embassy_executor::main]
13async fn main(_spawner: Spawner, p: Peripherals) { 13async fn main(_spawner: Spawner, p: Peripherals) {
14 info!("Hello Flash!"); 14 info!("Hello Flash!");
15 15
diff --git a/examples/stm32f3/src/bin/hello.rs b/examples/stm32f3/src/bin/hello.rs
index 3b89f1c72..bd9953a0e 100644
--- a/examples/stm32f3/src/bin/hello.rs
+++ b/examples/stm32f3/src/bin/hello.rs
@@ -3,8 +3,8 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::info; 5use defmt::info;
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy::time::{Duration, Timer}; 7use embassy_executor::time::{Duration, Timer};
8use embassy_stm32::time::Hertz; 8use embassy_stm32::time::Hertz;
9use embassy_stm32::{Config, Peripherals}; 9use embassy_stm32::{Config, Peripherals};
10use {defmt_rtt as _, panic_probe as _}; 10use {defmt_rtt as _, panic_probe as _};
@@ -16,7 +16,7 @@ fn config() -> Config {
16 config 16 config
17} 17}
18 18
19#[embassy::main(config = "config()")] 19#[embassy_executor::main(config = "config()")]
20async fn main(_spawner: Spawner, _p: Peripherals) -> ! { 20async fn main(_spawner: Spawner, _p: Peripherals) -> ! {
21 loop { 21 loop {
22 info!("Hello World!"); 22 info!("Hello World!");
diff --git a/examples/stm32f3/src/bin/multiprio.rs b/examples/stm32f3/src/bin/multiprio.rs
index 4f2cf9a6f..fba5b286e 100644
--- a/examples/stm32f3/src/bin/multiprio.rs
+++ b/examples/stm32f3/src/bin/multiprio.rs
@@ -59,14 +59,14 @@
59 59
60use cortex_m_rt::entry; 60use cortex_m_rt::entry;
61use defmt::*; 61use defmt::*;
62use embassy::time::{Duration, Instant, Timer}; 62use embassy_executor::time::{Duration, Instant, Timer};
63use embassy::util::Forever;
64use embassy_stm32::executor::{Executor, InterruptExecutor}; 63use embassy_stm32::executor::{Executor, InterruptExecutor};
65use embassy_stm32::interrupt; 64use embassy_stm32::interrupt;
66use embassy_stm32::interrupt::InterruptExt; 65use embassy_stm32::interrupt::InterruptExt;
66use embassy_util::Forever;
67use {defmt_rtt as _, panic_probe as _}; 67use {defmt_rtt as _, panic_probe as _};
68 68
69#[embassy::task] 69#[embassy_executor::task]
70async fn run_high() { 70async fn run_high() {
71 loop { 71 loop {
72 info!(" [high] tick!"); 72 info!(" [high] tick!");
@@ -74,7 +74,7 @@ async fn run_high() {
74 } 74 }
75} 75}
76 76
77#[embassy::task] 77#[embassy_executor::task]
78async fn run_med() { 78async fn run_med() {
79 loop { 79 loop {
80 let start = Instant::now(); 80 let start = Instant::now();
@@ -91,7 +91,7 @@ async fn run_med() {
91 } 91 }
92} 92}
93 93
94#[embassy::task] 94#[embassy_executor::task]
95async fn run_low() { 95async fn run_low() {
96 loop { 96 loop {
97 let start = Instant::now(); 97 let start = Instant::now();
diff --git a/examples/stm32f3/src/bin/spi_dma.rs b/examples/stm32f3/src/bin/spi_dma.rs
index ece1ae6fe..f554c509a 100644
--- a/examples/stm32f3/src/bin/spi_dma.rs
+++ b/examples/stm32f3/src/bin/spi_dma.rs
@@ -6,14 +6,14 @@ use core::fmt::Write;
6use core::str::from_utf8; 6use core::str::from_utf8;
7 7
8use defmt::*; 8use defmt::*;
9use embassy::executor::Spawner; 9use embassy_executor::executor::Spawner;
10use embassy_stm32::spi::{Config, Spi}; 10use embassy_stm32::spi::{Config, Spi};
11use embassy_stm32::time::Hertz; 11use embassy_stm32::time::Hertz;
12use embassy_stm32::Peripherals; 12use embassy_stm32::Peripherals;
13use heapless::String; 13use heapless::String;
14use {defmt_rtt as _, panic_probe as _}; 14use {defmt_rtt as _, panic_probe as _};
15 15
16#[embassy::main] 16#[embassy_executor::main]
17async fn main(_spawner: Spawner, p: Peripherals) { 17async fn main(_spawner: Spawner, p: Peripherals) {
18 info!("Hello World!"); 18 info!("Hello World!");
19 19
diff --git a/examples/stm32f3/src/bin/usart_dma.rs b/examples/stm32f3/src/bin/usart_dma.rs
index 4660f812e..62d165029 100644
--- a/examples/stm32f3/src/bin/usart_dma.rs
+++ b/examples/stm32f3/src/bin/usart_dma.rs
@@ -5,14 +5,14 @@
5use core::fmt::Write; 5use core::fmt::Write;
6 6
7use defmt::*; 7use defmt::*;
8use embassy::executor::Spawner; 8use embassy_executor::executor::Spawner;
9use embassy_stm32::dma::NoDma; 9use embassy_stm32::dma::NoDma;
10use embassy_stm32::usart::{Config, Uart}; 10use embassy_stm32::usart::{Config, Uart};
11use embassy_stm32::Peripherals; 11use embassy_stm32::Peripherals;
12use heapless::String; 12use heapless::String;
13use {defmt_rtt as _, panic_probe as _}; 13use {defmt_rtt as _, panic_probe as _};
14 14
15#[embassy::main] 15#[embassy_executor::main]
16async fn main(_spawner: Spawner, p: Peripherals) { 16async fn main(_spawner: Spawner, p: Peripherals) {
17 info!("Hello World!"); 17 info!("Hello World!");
18 18
diff --git a/examples/stm32f3/src/bin/usb_serial.rs b/examples/stm32f3/src/bin/usb_serial.rs
index 463d561ec..87b1138f5 100644
--- a/examples/stm32f3/src/bin/usb_serial.rs
+++ b/examples/stm32f3/src/bin/usb_serial.rs
@@ -3,8 +3,8 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::{panic, *}; 5use defmt::{panic, *};
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy::time::{Duration, Timer}; 7use embassy_executor::time::{Duration, Timer};
8use embassy_stm32::gpio::{Level, Output, Speed}; 8use embassy_stm32::gpio::{Level, Output, Speed};
9use embassy_stm32::time::mhz; 9use embassy_stm32::time::mhz;
10use embassy_stm32::usb::{Driver, Instance}; 10use embassy_stm32::usb::{Driver, Instance};
@@ -27,7 +27,7 @@ fn config() -> Config {
27 config 27 config
28} 28}
29 29
30#[embassy::main(config = "config()")] 30#[embassy_executor::main(config = "config()")]
31async fn main(_spawner: Spawner, p: Peripherals) { 31async fn main(_spawner: Spawner, p: Peripherals) {
32 info!("Hello World!"); 32 info!("Hello World!");
33 33
diff --git a/examples/stm32f4/Cargo.toml b/examples/stm32f4/Cargo.toml
index 100c0e608..37464b1e0 100644
--- a/examples/stm32f4/Cargo.toml
+++ b/examples/stm32f4/Cargo.toml
@@ -5,7 +5,8 @@ version = "0.1.0"
5 5
6 6
7[dependencies] 7[dependencies]
8embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt", "defmt-timestamp-uptime", "unstable-traits", "time-tick-32768hz"] } 8embassy-util = { version = "0.1.0", path = "../../embassy-util", features = ["defmt"] }
9embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "defmt-timestamp-uptime", "unstable-traits", "time-tick-32768hz"] }
9embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "unstable-traits", "defmt", "stm32f429zi", "unstable-pac", "memory-x", "time-driver-any", "exti"] } 10embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "unstable-traits", "defmt", "stm32f429zi", "unstable-pac", "memory-x", "time-driver-any", "exti"] }
10 11
11defmt = "0.3" 12defmt = "0.3"
diff --git a/examples/stm32f4/src/bin/adc.rs b/examples/stm32f4/src/bin/adc.rs
index 84ddbfd3c..27ed4fcc5 100644
--- a/examples/stm32f4/src/bin/adc.rs
+++ b/examples/stm32f4/src/bin/adc.rs
@@ -3,13 +3,13 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::*; 5use defmt::*;
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy::time::{Delay, Duration, Timer}; 7use embassy_executor::time::{Delay, Duration, Timer};
8use embassy_stm32::adc::Adc; 8use embassy_stm32::adc::Adc;
9use embassy_stm32::Peripherals; 9use embassy_stm32::Peripherals;
10use {defmt_rtt as _, panic_probe as _}; 10use {defmt_rtt as _, panic_probe as _};
11 11
12#[embassy::main] 12#[embassy_executor::main]
13async fn main(_spawner: Spawner, p: Peripherals) { 13async fn main(_spawner: Spawner, p: Peripherals) {
14 info!("Hello World!"); 14 info!("Hello World!");
15 15
diff --git a/examples/stm32f4/src/bin/blinky.rs b/examples/stm32f4/src/bin/blinky.rs
index 907492b3d..f71fe0989 100644
--- a/examples/stm32f4/src/bin/blinky.rs
+++ b/examples/stm32f4/src/bin/blinky.rs
@@ -3,13 +3,13 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::*; 5use defmt::*;
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy::time::{Duration, Timer}; 7use embassy_executor::time::{Duration, Timer};
8use embassy_stm32::gpio::{Level, Output, Speed}; 8use embassy_stm32::gpio::{Level, Output, Speed};
9use embassy_stm32::Peripherals; 9use embassy_stm32::Peripherals;
10use {defmt_rtt as _, panic_probe as _}; 10use {defmt_rtt as _, panic_probe as _};
11 11
12#[embassy::main] 12#[embassy_executor::main]
13async fn main(_spawner: Spawner, p: Peripherals) { 13async fn main(_spawner: Spawner, p: Peripherals) {
14 info!("Hello World!"); 14 info!("Hello World!");
15 15
diff --git a/examples/stm32f4/src/bin/button_exti.rs b/examples/stm32f4/src/bin/button_exti.rs
index 24ece9927..60dfb362b 100644
--- a/examples/stm32f4/src/bin/button_exti.rs
+++ b/examples/stm32f4/src/bin/button_exti.rs
@@ -3,13 +3,13 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::*; 5use defmt::*;
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy_stm32::exti::ExtiInput; 7use embassy_stm32::exti::ExtiInput;
8use embassy_stm32::gpio::{Input, Pull}; 8use embassy_stm32::gpio::{Input, Pull};
9use embassy_stm32::Peripherals; 9use embassy_stm32::Peripherals;
10use {defmt_rtt as _, panic_probe as _}; 10use {defmt_rtt as _, panic_probe as _};
11 11
12#[embassy::main] 12#[embassy_executor::main]
13async fn main(_spawner: Spawner, p: Peripherals) { 13async fn main(_spawner: Spawner, p: Peripherals) {
14 info!("Hello World!"); 14 info!("Hello World!");
15 15
diff --git a/examples/stm32f4/src/bin/flash.rs b/examples/stm32f4/src/bin/flash.rs
index 13fd2c90b..4f780656e 100644
--- a/examples/stm32f4/src/bin/flash.rs
+++ b/examples/stm32f4/src/bin/flash.rs
@@ -3,13 +3,13 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::{info, unwrap}; 5use defmt::{info, unwrap};
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy_stm32::flash::Flash; 7use embassy_stm32::flash::Flash;
8use embassy_stm32::Peripherals; 8use embassy_stm32::Peripherals;
9use embedded_storage::nor_flash::{NorFlash, ReadNorFlash}; 9use embedded_storage::nor_flash::{NorFlash, ReadNorFlash};
10use {defmt_rtt as _, panic_probe as _}; 10use {defmt_rtt as _, panic_probe as _};
11 11
12#[embassy::main] 12#[embassy_executor::main]
13async fn main(_spawner: Spawner, p: Peripherals) { 13async fn main(_spawner: Spawner, p: Peripherals) {
14 info!("Hello Flash!"); 14 info!("Hello Flash!");
15 15
diff --git a/examples/stm32f4/src/bin/hello.rs b/examples/stm32f4/src/bin/hello.rs
index 8e69e89d1..f957656ef 100644
--- a/examples/stm32f4/src/bin/hello.rs
+++ b/examples/stm32f4/src/bin/hello.rs
@@ -3,8 +3,8 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::info; 5use defmt::info;
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy::time::{Duration, Timer}; 7use embassy_executor::time::{Duration, Timer};
8use embassy_stm32::time::Hertz; 8use embassy_stm32::time::Hertz;
9use embassy_stm32::{Config, Peripherals}; 9use embassy_stm32::{Config, Peripherals};
10use {defmt_rtt as _, panic_probe as _}; 10use {defmt_rtt as _, panic_probe as _};
@@ -15,7 +15,7 @@ fn config() -> Config {
15 config 15 config
16} 16}
17 17
18#[embassy::main(config = "config()")] 18#[embassy_executor::main(config = "config()")]
19async fn main(_spawner: Spawner, _p: Peripherals) -> ! { 19async fn main(_spawner: Spawner, _p: Peripherals) -> ! {
20 loop { 20 loop {
21 info!("Hello World!"); 21 info!("Hello World!");
diff --git a/examples/stm32f4/src/bin/multiprio.rs b/examples/stm32f4/src/bin/multiprio.rs
index 4f2cf9a6f..fba5b286e 100644
--- a/examples/stm32f4/src/bin/multiprio.rs
+++ b/examples/stm32f4/src/bin/multiprio.rs
@@ -59,14 +59,14 @@
59 59
60use cortex_m_rt::entry; 60use cortex_m_rt::entry;
61use defmt::*; 61use defmt::*;
62use embassy::time::{Duration, Instant, Timer}; 62use embassy_executor::time::{Duration, Instant, Timer};
63use embassy::util::Forever;
64use embassy_stm32::executor::{Executor, InterruptExecutor}; 63use embassy_stm32::executor::{Executor, InterruptExecutor};
65use embassy_stm32::interrupt; 64use embassy_stm32::interrupt;
66use embassy_stm32::interrupt::InterruptExt; 65use embassy_stm32::interrupt::InterruptExt;
66use embassy_util::Forever;
67use {defmt_rtt as _, panic_probe as _}; 67use {defmt_rtt as _, panic_probe as _};
68 68
69#[embassy::task] 69#[embassy_executor::task]
70async fn run_high() { 70async fn run_high() {
71 loop { 71 loop {
72 info!(" [high] tick!"); 72 info!(" [high] tick!");
@@ -74,7 +74,7 @@ async fn run_high() {
74 } 74 }
75} 75}
76 76
77#[embassy::task] 77#[embassy_executor::task]
78async fn run_med() { 78async fn run_med() {
79 loop { 79 loop {
80 let start = Instant::now(); 80 let start = Instant::now();
@@ -91,7 +91,7 @@ async fn run_med() {
91 } 91 }
92} 92}
93 93
94#[embassy::task] 94#[embassy_executor::task]
95async fn run_low() { 95async fn run_low() {
96 loop { 96 loop {
97 let start = Instant::now(); 97 let start = Instant::now();
diff --git a/examples/stm32f4/src/bin/pwm.rs b/examples/stm32f4/src/bin/pwm.rs
index b39bbbe28..0b352c2b7 100644
--- a/examples/stm32f4/src/bin/pwm.rs
+++ b/examples/stm32f4/src/bin/pwm.rs
@@ -3,15 +3,15 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::*; 5use defmt::*;
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy::time::{Duration, Timer}; 7use embassy_executor::time::{Duration, Timer};
8use embassy_stm32::pwm::simple_pwm::{PwmPin, SimplePwm}; 8use embassy_stm32::pwm::simple_pwm::{PwmPin, SimplePwm};
9use embassy_stm32::pwm::Channel; 9use embassy_stm32::pwm::Channel;
10use embassy_stm32::time::khz; 10use embassy_stm32::time::khz;
11use embassy_stm32::Peripherals; 11use embassy_stm32::Peripherals;
12use {defmt_rtt as _, panic_probe as _}; 12use {defmt_rtt as _, panic_probe as _};
13 13
14#[embassy::main] 14#[embassy_executor::main]
15async fn main(_spawner: Spawner, p: Peripherals) { 15async fn main(_spawner: Spawner, p: Peripherals) {
16 info!("Hello World!"); 16 info!("Hello World!");
17 17
diff --git a/examples/stm32f4/src/bin/sdmmc.rs b/examples/stm32f4/src/bin/sdmmc.rs
index 752ad57bf..6eef19963 100644
--- a/examples/stm32f4/src/bin/sdmmc.rs
+++ b/examples/stm32f4/src/bin/sdmmc.rs
@@ -3,7 +3,7 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::*; 5use defmt::*;
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy_stm32::sdmmc::Sdmmc; 7use embassy_stm32::sdmmc::Sdmmc;
8use embassy_stm32::time::mhz; 8use embassy_stm32::time::mhz;
9use embassy_stm32::{interrupt, Config, Peripherals}; 9use embassy_stm32::{interrupt, Config, Peripherals};
@@ -15,7 +15,7 @@ fn config() -> Config {
15 config 15 config
16} 16}
17 17
18#[embassy::main(config = "config()")] 18#[embassy_executor::main(config = "config()")]
19async fn main(_spawner: Spawner, p: Peripherals) -> ! { 19async fn main(_spawner: Spawner, p: Peripherals) -> ! {
20 info!("Hello World!"); 20 info!("Hello World!");
21 21
diff --git a/examples/stm32f4/src/bin/spi_dma.rs b/examples/stm32f4/src/bin/spi_dma.rs
index f3c0f2cd5..023ca0971 100644
--- a/examples/stm32f4/src/bin/spi_dma.rs
+++ b/examples/stm32f4/src/bin/spi_dma.rs
@@ -6,14 +6,14 @@ use core::fmt::Write;
6use core::str::from_utf8; 6use core::str::from_utf8;
7 7
8use defmt::*; 8use defmt::*;
9use embassy::executor::Spawner; 9use embassy_executor::executor::Spawner;
10use embassy_stm32::spi::{Config, Spi}; 10use embassy_stm32::spi::{Config, Spi};
11use embassy_stm32::time::Hertz; 11use embassy_stm32::time::Hertz;
12use embassy_stm32::Peripherals; 12use embassy_stm32::Peripherals;
13use heapless::String; 13use heapless::String;
14use {defmt_rtt as _, panic_probe as _}; 14use {defmt_rtt as _, panic_probe as _};
15 15
16#[embassy::main] 16#[embassy_executor::main]
17async fn main(_spawner: Spawner, p: Peripherals) { 17async fn main(_spawner: Spawner, p: Peripherals) {
18 info!("Hello World!"); 18 info!("Hello World!");
19 19
diff --git a/examples/stm32f4/src/bin/usart_buffered.rs b/examples/stm32f4/src/bin/usart_buffered.rs
index 039e43bd2..2555998ce 100644
--- a/examples/stm32f4/src/bin/usart_buffered.rs
+++ b/examples/stm32f4/src/bin/usart_buffered.rs
@@ -3,14 +3,14 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::*; 5use defmt::*;
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy_stm32::dma::NoDma; 7use embassy_stm32::dma::NoDma;
8use embassy_stm32::usart::{BufferedUart, Config, State, Uart}; 8use embassy_stm32::usart::{BufferedUart, Config, State, Uart};
9use embassy_stm32::{interrupt, Peripherals}; 9use embassy_stm32::{interrupt, Peripherals};
10use embedded_io::asynch::BufRead; 10use embedded_io::asynch::BufRead;
11use {defmt_rtt as _, panic_probe as _}; 11use {defmt_rtt as _, panic_probe as _};
12 12
13#[embassy::main] 13#[embassy_executor::main]
14async fn main(_spawner: Spawner, p: Peripherals) { 14async fn main(_spawner: Spawner, p: Peripherals) {
15 info!("Hello World!"); 15 info!("Hello World!");
16 16
diff --git a/examples/stm32f4/src/bin/usart_dma.rs b/examples/stm32f4/src/bin/usart_dma.rs
index 8d06f8439..7859ba2ae 100644
--- a/examples/stm32f4/src/bin/usart_dma.rs
+++ b/examples/stm32f4/src/bin/usart_dma.rs
@@ -5,14 +5,14 @@
5use core::fmt::Write; 5use core::fmt::Write;
6 6
7use defmt::*; 7use defmt::*;
8use embassy::executor::Spawner; 8use embassy_executor::executor::Spawner;
9use embassy_stm32::dma::NoDma; 9use embassy_stm32::dma::NoDma;
10use embassy_stm32::usart::{Config, Uart}; 10use embassy_stm32::usart::{Config, Uart};
11use embassy_stm32::Peripherals; 11use embassy_stm32::Peripherals;
12use heapless::String; 12use heapless::String;
13use {defmt_rtt as _, panic_probe as _}; 13use {defmt_rtt as _, panic_probe as _};
14 14
15#[embassy::main] 15#[embassy_executor::main]
16async fn main(_spawner: Spawner, p: Peripherals) { 16async fn main(_spawner: Spawner, p: Peripherals) {
17 info!("Hello World!"); 17 info!("Hello World!");
18 18
diff --git a/examples/stm32f4/src/bin/wdt.rs b/examples/stm32f4/src/bin/wdt.rs
index bfc487c31..48394f4f1 100644
--- a/examples/stm32f4/src/bin/wdt.rs
+++ b/examples/stm32f4/src/bin/wdt.rs
@@ -3,14 +3,14 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::*; 5use defmt::*;
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy::time::{Duration, Timer}; 7use embassy_executor::time::{Duration, Timer};
8use embassy_stm32::gpio::{Level, Output, Speed}; 8use embassy_stm32::gpio::{Level, Output, Speed};
9use embassy_stm32::wdg::IndependentWatchdog; 9use embassy_stm32::wdg::IndependentWatchdog;
10use embassy_stm32::Peripherals; 10use embassy_stm32::Peripherals;
11use {defmt_rtt as _, panic_probe as _}; 11use {defmt_rtt as _, panic_probe as _};
12 12
13#[embassy::main] 13#[embassy_executor::main]
14async fn main(_spawner: Spawner, p: Peripherals) { 14async fn main(_spawner: Spawner, p: Peripherals) {
15 info!("Hello World!"); 15 info!("Hello World!");
16 16
diff --git a/examples/stm32f7/Cargo.toml b/examples/stm32f7/Cargo.toml
index b0a548a3f..081bed84f 100644
--- a/examples/stm32f7/Cargo.toml
+++ b/examples/stm32f7/Cargo.toml
@@ -4,7 +4,8 @@ name = "embassy-stm32f7-examples"
4version = "0.1.0" 4version = "0.1.0"
5 5
6[dependencies] 6[dependencies]
7embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt", "defmt-timestamp-uptime", "time-tick-32768hz"] } 7embassy-util = { version = "0.1.0", path = "../../embassy-util", features = ["defmt"] }
8embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "defmt-timestamp-uptime", "time-tick-32768hz"] }
8embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "net", "stm32f767zi", "unstable-pac", "time-driver-any", "exti"] } 9embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "net", "stm32f767zi", "unstable-pac", "time-driver-any", "exti"] }
9embassy-net = { path = "../../embassy-net", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet", "pool-16"] } 10embassy-net = { path = "../../embassy-net", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet", "pool-16"] }
10embedded-io = { version = "0.3.0", features = ["async"] } 11embedded-io = { version = "0.3.0", features = ["async"] }
diff --git a/examples/stm32f7/src/bin/adc.rs b/examples/stm32f7/src/bin/adc.rs
index fc8359622..2a813c050 100644
--- a/examples/stm32f7/src/bin/adc.rs
+++ b/examples/stm32f7/src/bin/adc.rs
@@ -3,13 +3,13 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::*; 5use defmt::*;
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy::time::{Delay, Duration, Timer}; 7use embassy_executor::time::{Delay, Duration, Timer};
8use embassy_stm32::adc::Adc; 8use embassy_stm32::adc::Adc;
9use embassy_stm32::Peripherals; 9use embassy_stm32::Peripherals;
10use {defmt_rtt as _, panic_probe as _}; 10use {defmt_rtt as _, panic_probe as _};
11 11
12#[embassy::main] 12#[embassy_executor::main]
13async fn main(_spawner: Spawner, p: Peripherals) { 13async fn main(_spawner: Spawner, p: Peripherals) {
14 info!("Hello World!"); 14 info!("Hello World!");
15 15
diff --git a/examples/stm32f7/src/bin/blinky.rs b/examples/stm32f7/src/bin/blinky.rs
index 907492b3d..f71fe0989 100644
--- a/examples/stm32f7/src/bin/blinky.rs
+++ b/examples/stm32f7/src/bin/blinky.rs
@@ -3,13 +3,13 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::*; 5use defmt::*;
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy::time::{Duration, Timer}; 7use embassy_executor::time::{Duration, Timer};
8use embassy_stm32::gpio::{Level, Output, Speed}; 8use embassy_stm32::gpio::{Level, Output, Speed};
9use embassy_stm32::Peripherals; 9use embassy_stm32::Peripherals;
10use {defmt_rtt as _, panic_probe as _}; 10use {defmt_rtt as _, panic_probe as _};
11 11
12#[embassy::main] 12#[embassy_executor::main]
13async fn main(_spawner: Spawner, p: Peripherals) { 13async fn main(_spawner: Spawner, p: Peripherals) {
14 info!("Hello World!"); 14 info!("Hello World!");
15 15
diff --git a/examples/stm32f7/src/bin/button_exti.rs b/examples/stm32f7/src/bin/button_exti.rs
index 24ece9927..60dfb362b 100644
--- a/examples/stm32f7/src/bin/button_exti.rs
+++ b/examples/stm32f7/src/bin/button_exti.rs
@@ -3,13 +3,13 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::*; 5use defmt::*;
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy_stm32::exti::ExtiInput; 7use embassy_stm32::exti::ExtiInput;
8use embassy_stm32::gpio::{Input, Pull}; 8use embassy_stm32::gpio::{Input, Pull};
9use embassy_stm32::Peripherals; 9use embassy_stm32::Peripherals;
10use {defmt_rtt as _, panic_probe as _}; 10use {defmt_rtt as _, panic_probe as _};
11 11
12#[embassy::main] 12#[embassy_executor::main]
13async fn main(_spawner: Spawner, p: Peripherals) { 13async fn main(_spawner: Spawner, p: Peripherals) {
14 info!("Hello World!"); 14 info!("Hello World!");
15 15
diff --git a/examples/stm32f7/src/bin/eth.rs b/examples/stm32f7/src/bin/eth.rs
index 177683c3a..33504af76 100644
--- a/examples/stm32f7/src/bin/eth.rs
+++ b/examples/stm32f7/src/bin/eth.rs
@@ -3,9 +3,8 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::*; 5use defmt::*;
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy::time::{Duration, Timer}; 7use embassy_executor::time::{Duration, Timer};
8use embassy::util::Forever;
9use embassy_net::tcp::TcpSocket; 8use embassy_net::tcp::TcpSocket;
10use embassy_net::{Ipv4Address, Stack, StackResources}; 9use embassy_net::{Ipv4Address, Stack, StackResources};
11use embassy_stm32::eth::generic_smi::GenericSMI; 10use embassy_stm32::eth::generic_smi::GenericSMI;
@@ -14,6 +13,7 @@ use embassy_stm32::peripherals::ETH;
14use embassy_stm32::rng::Rng; 13use embassy_stm32::rng::Rng;
15use embassy_stm32::time::mhz; 14use embassy_stm32::time::mhz;
16use embassy_stm32::{interrupt, Config, Peripherals}; 15use embassy_stm32::{interrupt, Config, Peripherals};
16use embassy_util::Forever;
17use embedded_io::asynch::Write; 17use embedded_io::asynch::Write;
18use rand_core::RngCore; 18use rand_core::RngCore;
19use {defmt_rtt as _, panic_probe as _}; 19use {defmt_rtt as _, panic_probe as _};
@@ -28,7 +28,7 @@ macro_rules! forever {
28 28
29type Device = Ethernet<'static, ETH, GenericSMI, 4, 4>; 29type Device = Ethernet<'static, ETH, GenericSMI, 4, 4>;
30 30
31#[embassy::task] 31#[embassy_executor::task]
32async fn net_task(stack: &'static Stack<Device>) -> ! { 32async fn net_task(stack: &'static Stack<Device>) -> ! {
33 stack.run().await 33 stack.run().await
34} 34}
@@ -39,7 +39,7 @@ fn config() -> Config {
39 config 39 config
40} 40}
41 41
42#[embassy::main(config = "config()")] 42#[embassy_executor::main(config = "config()")]
43async fn main(spawner: Spawner, p: Peripherals) -> ! { 43async fn main(spawner: Spawner, p: Peripherals) -> ! {
44 info!("Hello World!"); 44 info!("Hello World!");
45 45
diff --git a/examples/stm32f7/src/bin/flash.rs b/examples/stm32f7/src/bin/flash.rs
index af66275d4..15864cabb 100644
--- a/examples/stm32f7/src/bin/flash.rs
+++ b/examples/stm32f7/src/bin/flash.rs
@@ -3,14 +3,14 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::{info, unwrap}; 5use defmt::{info, unwrap};
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy::time::{Duration, Timer}; 7use embassy_executor::time::{Duration, Timer};
8use embassy_stm32::flash::Flash; 8use embassy_stm32::flash::Flash;
9use embassy_stm32::Peripherals; 9use embassy_stm32::Peripherals;
10use embedded_storage::nor_flash::{NorFlash, ReadNorFlash}; 10use embedded_storage::nor_flash::{NorFlash, ReadNorFlash};
11use {defmt_rtt as _, panic_probe as _}; 11use {defmt_rtt as _, panic_probe as _};
12 12
13#[embassy::main] 13#[embassy_executor::main]
14async fn main(_spawner: Spawner, p: Peripherals) { 14async fn main(_spawner: Spawner, p: Peripherals) {
15 info!("Hello Flash!"); 15 info!("Hello Flash!");
16 16
diff --git a/examples/stm32f7/src/bin/hello.rs b/examples/stm32f7/src/bin/hello.rs
index 8e69e89d1..f957656ef 100644
--- a/examples/stm32f7/src/bin/hello.rs
+++ b/examples/stm32f7/src/bin/hello.rs
@@ -3,8 +3,8 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::info; 5use defmt::info;
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy::time::{Duration, Timer}; 7use embassy_executor::time::{Duration, Timer};
8use embassy_stm32::time::Hertz; 8use embassy_stm32::time::Hertz;
9use embassy_stm32::{Config, Peripherals}; 9use embassy_stm32::{Config, Peripherals};
10use {defmt_rtt as _, panic_probe as _}; 10use {defmt_rtt as _, panic_probe as _};
@@ -15,7 +15,7 @@ fn config() -> Config {
15 config 15 config
16} 16}
17 17
18#[embassy::main(config = "config()")] 18#[embassy_executor::main(config = "config()")]
19async fn main(_spawner: Spawner, _p: Peripherals) -> ! { 19async fn main(_spawner: Spawner, _p: Peripherals) -> ! {
20 loop { 20 loop {
21 info!("Hello World!"); 21 info!("Hello World!");
diff --git a/examples/stm32f7/src/bin/sdmmc.rs b/examples/stm32f7/src/bin/sdmmc.rs
index be1c2b152..1f321df17 100644
--- a/examples/stm32f7/src/bin/sdmmc.rs
+++ b/examples/stm32f7/src/bin/sdmmc.rs
@@ -3,7 +3,7 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::*; 5use defmt::*;
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy_stm32::sdmmc::Sdmmc; 7use embassy_stm32::sdmmc::Sdmmc;
8use embassy_stm32::time::mhz; 8use embassy_stm32::time::mhz;
9use embassy_stm32::{interrupt, Config, Peripherals}; 9use embassy_stm32::{interrupt, Config, Peripherals};
@@ -15,7 +15,7 @@ fn config() -> Config {
15 config 15 config
16} 16}
17 17
18#[embassy::main(config = "config()")] 18#[embassy_executor::main(config = "config()")]
19async fn main(_spawner: Spawner, p: Peripherals) -> ! { 19async fn main(_spawner: Spawner, p: Peripherals) -> ! {
20 info!("Hello World!"); 20 info!("Hello World!");
21 21
diff --git a/examples/stm32f7/src/bin/usart_dma.rs b/examples/stm32f7/src/bin/usart_dma.rs
index d8551620c..9884d1634 100644
--- a/examples/stm32f7/src/bin/usart_dma.rs
+++ b/examples/stm32f7/src/bin/usart_dma.rs
@@ -5,14 +5,14 @@
5use core::fmt::Write; 5use core::fmt::Write;
6 6
7use defmt::*; 7use defmt::*;
8use embassy::executor::Spawner; 8use embassy_executor::executor::Spawner;
9use embassy_stm32::dma::NoDma; 9use embassy_stm32::dma::NoDma;
10use embassy_stm32::usart::{Config, Uart}; 10use embassy_stm32::usart::{Config, Uart};
11use embassy_stm32::Peripherals; 11use embassy_stm32::Peripherals;
12use heapless::String; 12use heapless::String;
13use {defmt_rtt as _, panic_probe as _}; 13use {defmt_rtt as _, panic_probe as _};
14 14
15#[embassy::main] 15#[embassy_executor::main]
16async fn main(_spawner: Spawner, p: Peripherals) { 16async fn main(_spawner: Spawner, p: Peripherals) {
17 let config = Config::default(); 17 let config = Config::default();
18 let mut usart = Uart::new(p.UART7, p.PA8, p.PA15, p.DMA1_CH1, NoDma, config); 18 let mut usart = Uart::new(p.UART7, p.PA8, p.PA15, p.DMA1_CH1, NoDma, config);
diff --git a/examples/stm32g0/Cargo.toml b/examples/stm32g0/Cargo.toml
index bf23fa822..3dedeac63 100644
--- a/examples/stm32g0/Cargo.toml
+++ b/examples/stm32g0/Cargo.toml
@@ -4,7 +4,8 @@ name = "embassy-stm32g0-examples"
4version = "0.1.0" 4version = "0.1.0"
5 5
6[dependencies] 6[dependencies]
7embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt", "defmt-timestamp-uptime", "time-tick-32768hz"] } 7embassy-util = { version = "0.1.0", path = "../../embassy-util", features = ["defmt"] }
8embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "defmt-timestamp-uptime", "time-tick-32768hz"] }
8embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "time-driver-any", "stm32g071rb", "memory-x", "unstable-pac", "exti"] } 9embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "time-driver-any", "stm32g071rb", "memory-x", "unstable-pac", "exti"] }
9 10
10defmt = "0.3" 11defmt = "0.3"
diff --git a/examples/stm32g0/src/bin/blinky.rs b/examples/stm32g0/src/bin/blinky.rs
index 907492b3d..f71fe0989 100644
--- a/examples/stm32g0/src/bin/blinky.rs
+++ b/examples/stm32g0/src/bin/blinky.rs
@@ -3,13 +3,13 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::*; 5use defmt::*;
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy::time::{Duration, Timer}; 7use embassy_executor::time::{Duration, Timer};
8use embassy_stm32::gpio::{Level, Output, Speed}; 8use embassy_stm32::gpio::{Level, Output, Speed};
9use embassy_stm32::Peripherals; 9use embassy_stm32::Peripherals;
10use {defmt_rtt as _, panic_probe as _}; 10use {defmt_rtt as _, panic_probe as _};
11 11
12#[embassy::main] 12#[embassy_executor::main]
13async fn main(_spawner: Spawner, p: Peripherals) { 13async fn main(_spawner: Spawner, p: Peripherals) {
14 info!("Hello World!"); 14 info!("Hello World!");
15 15
diff --git a/examples/stm32g0/src/bin/button_exti.rs b/examples/stm32g0/src/bin/button_exti.rs
index 924feeb33..0832386ed 100644
--- a/examples/stm32g0/src/bin/button_exti.rs
+++ b/examples/stm32g0/src/bin/button_exti.rs
@@ -3,13 +3,13 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::*; 5use defmt::*;
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy_stm32::exti::ExtiInput; 7use embassy_stm32::exti::ExtiInput;
8use embassy_stm32::gpio::{Input, Pull}; 8use embassy_stm32::gpio::{Input, Pull};
9use embassy_stm32::Peripherals; 9use embassy_stm32::Peripherals;
10use {defmt_rtt as _, panic_probe as _}; 10use {defmt_rtt as _, panic_probe as _};
11 11
12#[embassy::main] 12#[embassy_executor::main]
13async fn main(_spawner: Spawner, p: Peripherals) { 13async fn main(_spawner: Spawner, p: Peripherals) {
14 info!("Hello World!"); 14 info!("Hello World!");
15 15
diff --git a/examples/stm32g4/Cargo.toml b/examples/stm32g4/Cargo.toml
index d3641c489..60c62ad1e 100644
--- a/examples/stm32g4/Cargo.toml
+++ b/examples/stm32g4/Cargo.toml
@@ -4,7 +4,8 @@ name = "embassy-stm32g4-examples"
4version = "0.1.0" 4version = "0.1.0"
5 5
6[dependencies] 6[dependencies]
7embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt", "defmt-timestamp-uptime", "time-tick-32768hz"] } 7embassy-util = { version = "0.1.0", path = "../../embassy-util", features = ["defmt"] }
8embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "defmt-timestamp-uptime", "time-tick-32768hz"] }
8embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "time-driver-any", "stm32g491re", "memory-x", "unstable-pac", "exti"] } 9embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "time-driver-any", "stm32g491re", "memory-x", "unstable-pac", "exti"] }
9embassy-hal-common = {version = "0.1.0", path = "../../embassy-hal-common" } 10embassy-hal-common = {version = "0.1.0", path = "../../embassy-hal-common" }
10 11
diff --git a/examples/stm32g4/src/bin/blinky.rs b/examples/stm32g4/src/bin/blinky.rs
index cd4883276..ea3c563b4 100644
--- a/examples/stm32g4/src/bin/blinky.rs
+++ b/examples/stm32g4/src/bin/blinky.rs
@@ -3,13 +3,13 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::*; 5use defmt::*;
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy::time::{Duration, Timer}; 7use embassy_executor::time::{Duration, Timer};
8use embassy_stm32::gpio::{Level, Output, Speed}; 8use embassy_stm32::gpio::{Level, Output, Speed};
9use embassy_stm32::Peripherals; 9use embassy_stm32::Peripherals;
10use {defmt_rtt as _, panic_probe as _}; 10use {defmt_rtt as _, panic_probe as _};
11 11
12#[embassy::main] 12#[embassy_executor::main]
13async fn main(_spawner: Spawner, p: Peripherals) { 13async fn main(_spawner: Spawner, p: Peripherals) {
14 info!("Hello World!"); 14 info!("Hello World!");
15 15
diff --git a/examples/stm32g4/src/bin/button_exti.rs b/examples/stm32g4/src/bin/button_exti.rs
index 24ece9927..60dfb362b 100644
--- a/examples/stm32g4/src/bin/button_exti.rs
+++ b/examples/stm32g4/src/bin/button_exti.rs
@@ -3,13 +3,13 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::*; 5use defmt::*;
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy_stm32::exti::ExtiInput; 7use embassy_stm32::exti::ExtiInput;
8use embassy_stm32::gpio::{Input, Pull}; 8use embassy_stm32::gpio::{Input, Pull};
9use embassy_stm32::Peripherals; 9use embassy_stm32::Peripherals;
10use {defmt_rtt as _, panic_probe as _}; 10use {defmt_rtt as _, panic_probe as _};
11 11
12#[embassy::main] 12#[embassy_executor::main]
13async fn main(_spawner: Spawner, p: Peripherals) { 13async fn main(_spawner: Spawner, p: Peripherals) {
14 info!("Hello World!"); 14 info!("Hello World!");
15 15
diff --git a/examples/stm32g4/src/bin/pwm.rs b/examples/stm32g4/src/bin/pwm.rs
index dc4e164ab..7c16d0a3a 100644
--- a/examples/stm32g4/src/bin/pwm.rs
+++ b/examples/stm32g4/src/bin/pwm.rs
@@ -3,15 +3,15 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::*; 5use defmt::*;
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy::time::{Duration, Timer}; 7use embassy_executor::time::{Duration, Timer};
8use embassy_stm32::pwm::simple_pwm::{PwmPin, SimplePwm}; 8use embassy_stm32::pwm::simple_pwm::{PwmPin, SimplePwm};
9use embassy_stm32::pwm::Channel; 9use embassy_stm32::pwm::Channel;
10use embassy_stm32::time::khz; 10use embassy_stm32::time::khz;
11use embassy_stm32::Peripherals; 11use embassy_stm32::Peripherals;
12use {defmt_rtt as _, panic_probe as _}; 12use {defmt_rtt as _, panic_probe as _};
13 13
14#[embassy::main] 14#[embassy_executor::main]
15async fn main(_spawner: Spawner, p: Peripherals) { 15async fn main(_spawner: Spawner, p: Peripherals) {
16 info!("Hello World!"); 16 info!("Hello World!");
17 17
diff --git a/examples/stm32h7/Cargo.toml b/examples/stm32h7/Cargo.toml
index d905031d6..8b1999b30 100644
--- a/examples/stm32h7/Cargo.toml
+++ b/examples/stm32h7/Cargo.toml
@@ -4,7 +4,8 @@ name = "embassy-stm32h7-examples"
4version = "0.1.0" 4version = "0.1.0"
5 5
6[dependencies] 6[dependencies]
7embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt", "defmt-timestamp-uptime", "unstable-traits", "time-tick-32768hz"] } 7embassy-util = { version = "0.1.0", path = "../../embassy-util", features = ["defmt"] }
8embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "defmt-timestamp-uptime", "unstable-traits", "time-tick-32768hz"] }
8embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32h743bi", "net", "time-driver-any", "exti", "unstable-pac", "unstable-traits"] } 9embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32h743bi", "net", "time-driver-any", "exti", "unstable-pac", "unstable-traits"] }
9embassy-net = { path = "../../embassy-net", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet", "pool-16"] } 10embassy-net = { path = "../../embassy-net", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet", "pool-16"] }
10embedded-io = { version = "0.3.0", features = ["async"] } 11embedded-io = { version = "0.3.0", features = ["async"] }
diff --git a/examples/stm32h7/src/bin/adc.rs b/examples/stm32h7/src/bin/adc.rs
index d8a5d23d7..f50976a30 100644
--- a/examples/stm32h7/src/bin/adc.rs
+++ b/examples/stm32h7/src/bin/adc.rs
@@ -3,8 +3,8 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::*; 5use defmt::*;
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy::time::{Delay, Duration, Timer}; 7use embassy_executor::time::{Delay, Duration, Timer};
8use embassy_stm32::adc::{Adc, SampleTime}; 8use embassy_stm32::adc::{Adc, SampleTime};
9use embassy_stm32::rcc::AdcClockSource; 9use embassy_stm32::rcc::AdcClockSource;
10use embassy_stm32::time::mhz; 10use embassy_stm32::time::mhz;
@@ -20,7 +20,7 @@ pub fn config() -> Config {
20 config 20 config
21} 21}
22 22
23#[embassy::main(config = "config()")] 23#[embassy_executor::main(config = "config()")]
24async fn main(_spawner: Spawner, mut p: Peripherals) { 24async fn main(_spawner: Spawner, mut p: Peripherals) {
25 info!("Hello World!"); 25 info!("Hello World!");
26 26
diff --git a/examples/stm32h7/src/bin/blinky.rs b/examples/stm32h7/src/bin/blinky.rs
index 7982f4a0b..98ce15cc6 100644
--- a/examples/stm32h7/src/bin/blinky.rs
+++ b/examples/stm32h7/src/bin/blinky.rs
@@ -3,13 +3,13 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::*; 5use defmt::*;
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy::time::{Duration, Timer}; 7use embassy_executor::time::{Duration, Timer};
8use embassy_stm32::gpio::{Level, Output, Speed}; 8use embassy_stm32::gpio::{Level, Output, Speed};
9use embassy_stm32::Peripherals; 9use embassy_stm32::Peripherals;
10use {defmt_rtt as _, panic_probe as _}; 10use {defmt_rtt as _, panic_probe as _};
11 11
12#[embassy::main] 12#[embassy_executor::main]
13async fn main(_spawner: Spawner, p: Peripherals) { 13async fn main(_spawner: Spawner, p: Peripherals) {
14 info!("Hello World!"); 14 info!("Hello World!");
15 15
diff --git a/examples/stm32h7/src/bin/button_exti.rs b/examples/stm32h7/src/bin/button_exti.rs
index 24ece9927..60dfb362b 100644
--- a/examples/stm32h7/src/bin/button_exti.rs
+++ b/examples/stm32h7/src/bin/button_exti.rs
@@ -3,13 +3,13 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::*; 5use defmt::*;
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy_stm32::exti::ExtiInput; 7use embassy_stm32::exti::ExtiInput;
8use embassy_stm32::gpio::{Input, Pull}; 8use embassy_stm32::gpio::{Input, Pull};
9use embassy_stm32::Peripherals; 9use embassy_stm32::Peripherals;
10use {defmt_rtt as _, panic_probe as _}; 10use {defmt_rtt as _, panic_probe as _};
11 11
12#[embassy::main] 12#[embassy_executor::main]
13async fn main(_spawner: Spawner, p: Peripherals) { 13async fn main(_spawner: Spawner, p: Peripherals) {
14 info!("Hello World!"); 14 info!("Hello World!");
15 15
diff --git a/examples/stm32h7/src/bin/camera.rs b/examples/stm32h7/src/bin/camera.rs
index 0d0179e62..69187182f 100644
--- a/examples/stm32h7/src/bin/camera.rs
+++ b/examples/stm32h7/src/bin/camera.rs
@@ -2,8 +2,8 @@
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use embassy::executor::Spawner; 5use embassy_executor::executor::Spawner;
6use embassy::time::{Duration, Timer}; 6use embassy_executor::time::{Duration, Timer};
7use embassy_stm32::dcmi::{self, *}; 7use embassy_stm32::dcmi::{self, *};
8use embassy_stm32::gpio::{Level, Output, Speed}; 8use embassy_stm32::gpio::{Level, Output, Speed};
9use embassy_stm32::i2c::I2c; 9use embassy_stm32::i2c::I2c;
@@ -32,7 +32,7 @@ const HEIGHT: usize = 100;
32 32
33static mut FRAME: [u32; WIDTH * HEIGHT / 2] = [0u32; WIDTH * HEIGHT / 2]; 33static mut FRAME: [u32; WIDTH * HEIGHT / 2] = [0u32; WIDTH * HEIGHT / 2];
34 34
35#[embassy::main(config = "config()")] 35#[embassy_executor::main(config = "config()")]
36async fn main(_spawner: Spawner, p: Peripherals) { 36async fn main(_spawner: Spawner, p: Peripherals) {
37 defmt::info!("Hello World!"); 37 defmt::info!("Hello World!");
38 let mco = Mco::new(p.MCO1, p.PA8, Mco1Source::Hsi, McoClock::Divided(3)); 38 let mco = Mco::new(p.MCO1, p.PA8, Mco1Source::Hsi, McoClock::Divided(3));
@@ -78,7 +78,7 @@ mod ov7725 {
78 use core::marker::PhantomData; 78 use core::marker::PhantomData;
79 79
80 use defmt::Format; 80 use defmt::Format;
81 use embassy::time::{Duration, Timer}; 81 use embassy_executor::time::{Duration, Timer};
82 use embassy_stm32::rcc::{Mco, McoInstance}; 82 use embassy_stm32::rcc::{Mco, McoInstance};
83 use embedded_hal_async::i2c::I2c; 83 use embedded_hal_async::i2c::I2c;
84 84
diff --git a/examples/stm32h7/src/bin/eth.rs b/examples/stm32h7/src/bin/eth.rs
index 556d472bd..4282fcedd 100644
--- a/examples/stm32h7/src/bin/eth.rs
+++ b/examples/stm32h7/src/bin/eth.rs
@@ -3,9 +3,8 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::*; 5use defmt::*;
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy::time::{Duration, Timer}; 7use embassy_executor::time::{Duration, Timer};
8use embassy::util::Forever;
9use embassy_net::tcp::TcpSocket; 8use embassy_net::tcp::TcpSocket;
10use embassy_net::{Ipv4Address, Stack, StackResources}; 9use embassy_net::{Ipv4Address, Stack, StackResources};
11use embassy_stm32::eth::generic_smi::GenericSMI; 10use embassy_stm32::eth::generic_smi::GenericSMI;
@@ -14,6 +13,7 @@ use embassy_stm32::peripherals::ETH;
14use embassy_stm32::rng::Rng; 13use embassy_stm32::rng::Rng;
15use embassy_stm32::time::mhz; 14use embassy_stm32::time::mhz;
16use embassy_stm32::{interrupt, Config, Peripherals}; 15use embassy_stm32::{interrupt, Config, Peripherals};
16use embassy_util::Forever;
17use embedded_io::asynch::Write; 17use embedded_io::asynch::Write;
18use rand_core::RngCore; 18use rand_core::RngCore;
19use {defmt_rtt as _, panic_probe as _}; 19use {defmt_rtt as _, panic_probe as _};
@@ -28,7 +28,7 @@ macro_rules! forever {
28 28
29type Device = Ethernet<'static, ETH, GenericSMI, 4, 4>; 29type Device = Ethernet<'static, ETH, GenericSMI, 4, 4>;
30 30
31#[embassy::task] 31#[embassy_executor::task]
32async fn net_task(stack: &'static Stack<Device>) -> ! { 32async fn net_task(stack: &'static Stack<Device>) -> ! {
33 stack.run().await 33 stack.run().await
34} 34}
@@ -41,7 +41,7 @@ pub fn config() -> Config {
41 config 41 config
42} 42}
43 43
44#[embassy::main(config = "config()")] 44#[embassy_executor::main(config = "config()")]
45async fn main(spawner: Spawner, p: Peripherals) -> ! { 45async fn main(spawner: Spawner, p: Peripherals) -> ! {
46 info!("Hello World!"); 46 info!("Hello World!");
47 47
diff --git a/examples/stm32h7/src/bin/flash.rs b/examples/stm32h7/src/bin/flash.rs
index 5f97d2b31..0c477deba 100644
--- a/examples/stm32h7/src/bin/flash.rs
+++ b/examples/stm32h7/src/bin/flash.rs
@@ -3,14 +3,14 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::{info, unwrap}; 5use defmt::{info, unwrap};
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy::time::{Duration, Timer}; 7use embassy_executor::time::{Duration, Timer};
8use embassy_stm32::flash::Flash; 8use embassy_stm32::flash::Flash;
9use embassy_stm32::Peripherals; 9use embassy_stm32::Peripherals;
10use embedded_storage::nor_flash::{NorFlash, ReadNorFlash}; 10use embedded_storage::nor_flash::{NorFlash, ReadNorFlash};
11use {defmt_rtt as _, panic_probe as _}; 11use {defmt_rtt as _, panic_probe as _};
12 12
13#[embassy::main] 13#[embassy_executor::main]
14async fn main(_spawner: Spawner, p: Peripherals) { 14async fn main(_spawner: Spawner, p: Peripherals) {
15 info!("Hello Flash!"); 15 info!("Hello Flash!");
16 16
diff --git a/examples/stm32h7/src/bin/fmc.rs b/examples/stm32h7/src/bin/fmc.rs
index 27c715ab0..5140a6e22 100644
--- a/examples/stm32h7/src/bin/fmc.rs
+++ b/examples/stm32h7/src/bin/fmc.rs
@@ -3,8 +3,8 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::*; 5use defmt::*;
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy::time::{Delay, Duration, Timer}; 7use embassy_executor::time::{Delay, Duration, Timer};
8use embassy_stm32::fmc::Fmc; 8use embassy_stm32::fmc::Fmc;
9use embassy_stm32::time::mhz; 9use embassy_stm32::time::mhz;
10use embassy_stm32::{Config, Peripherals}; 10use embassy_stm32::{Config, Peripherals};
@@ -18,7 +18,7 @@ pub fn config() -> Config {
18 config 18 config
19} 19}
20 20
21#[embassy::main(config = "config()")] 21#[embassy_executor::main(config = "config()")]
22async fn main(_spawner: Spawner, p: Peripherals) { 22async fn main(_spawner: Spawner, p: Peripherals) {
23 info!("Hello World!"); 23 info!("Hello World!");
24 24
diff --git a/examples/stm32h7/src/bin/low_level_timer_api.rs b/examples/stm32h7/src/bin/low_level_timer_api.rs
index d7c6da5bd..f2477c7a7 100644
--- a/examples/stm32h7/src/bin/low_level_timer_api.rs
+++ b/examples/stm32h7/src/bin/low_level_timer_api.rs
@@ -3,8 +3,8 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::*; 5use defmt::*;
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy::time::{Duration, Timer}; 7use embassy_executor::time::{Duration, Timer};
8use embassy_stm32::gpio::low_level::AFType; 8use embassy_stm32::gpio::low_level::AFType;
9use embassy_stm32::gpio::Speed; 9use embassy_stm32::gpio::Speed;
10use embassy_stm32::pwm::*; 10use embassy_stm32::pwm::*;
@@ -24,7 +24,7 @@ pub fn config() -> Config {
24 config 24 config
25} 25}
26 26
27#[embassy::main(config = "config()")] 27#[embassy_executor::main(config = "config()")]
28async fn main(_spawner: Spawner, p: Peripherals) { 28async fn main(_spawner: Spawner, p: Peripherals) {
29 info!("Hello World!"); 29 info!("Hello World!");
30 30
diff --git a/examples/stm32h7/src/bin/mco.rs b/examples/stm32h7/src/bin/mco.rs
index 6f03b5479..83ba3742b 100644
--- a/examples/stm32h7/src/bin/mco.rs
+++ b/examples/stm32h7/src/bin/mco.rs
@@ -3,14 +3,14 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::*; 5use defmt::*;
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy::time::{Duration, Timer}; 7use embassy_executor::time::{Duration, Timer};
8use embassy_stm32::gpio::{Level, Output, Speed}; 8use embassy_stm32::gpio::{Level, Output, Speed};
9use embassy_stm32::rcc::{Mco, Mco1Source, McoClock}; 9use embassy_stm32::rcc::{Mco, Mco1Source, McoClock};
10use embassy_stm32::Peripherals; 10use embassy_stm32::Peripherals;
11use {defmt_rtt as _, panic_probe as _}; 11use {defmt_rtt as _, panic_probe as _};
12 12
13#[embassy::main] 13#[embassy_executor::main]
14async fn main(_spawner: Spawner, p: Peripherals) { 14async fn main(_spawner: Spawner, p: Peripherals) {
15 info!("Hello World!"); 15 info!("Hello World!");
16 16
diff --git a/examples/stm32h7/src/bin/pwm.rs b/examples/stm32h7/src/bin/pwm.rs
index 730f637e9..36ed2e4a4 100644
--- a/examples/stm32h7/src/bin/pwm.rs
+++ b/examples/stm32h7/src/bin/pwm.rs
@@ -3,8 +3,8 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::*; 5use defmt::*;
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy::time::{Duration, Timer}; 7use embassy_executor::time::{Duration, Timer};
8use embassy_stm32::pwm::simple_pwm::{PwmPin, SimplePwm}; 8use embassy_stm32::pwm::simple_pwm::{PwmPin, SimplePwm};
9use embassy_stm32::pwm::Channel; 9use embassy_stm32::pwm::Channel;
10use embassy_stm32::time::{khz, mhz}; 10use embassy_stm32::time::{khz, mhz};
@@ -23,7 +23,7 @@ pub fn config() -> Config {
23 config 23 config
24} 24}
25 25
26#[embassy::main(config = "config()")] 26#[embassy_executor::main(config = "config()")]
27async fn main(_spawner: Spawner, p: Peripherals) { 27async fn main(_spawner: Spawner, p: Peripherals) {
28 info!("Hello World!"); 28 info!("Hello World!");
29 29
diff --git a/examples/stm32h7/src/bin/rng.rs b/examples/stm32h7/src/bin/rng.rs
index 2b42a6afd..81fb3d162 100644
--- a/examples/stm32h7/src/bin/rng.rs
+++ b/examples/stm32h7/src/bin/rng.rs
@@ -3,12 +3,12 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::*; 5use defmt::*;
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy_stm32::rng::Rng; 7use embassy_stm32::rng::Rng;
8use embassy_stm32::Peripherals; 8use embassy_stm32::Peripherals;
9use {defmt_rtt as _, panic_probe as _}; 9use {defmt_rtt as _, panic_probe as _};
10 10
11#[embassy::main] 11#[embassy_executor::main]
12async fn main(_spawner: Spawner, p: Peripherals) { 12async fn main(_spawner: Spawner, p: Peripherals) {
13 info!("Hello World!"); 13 info!("Hello World!");
14 14
diff --git a/examples/stm32h7/src/bin/sdmmc.rs b/examples/stm32h7/src/bin/sdmmc.rs
index 163807d86..19ae5ade1 100644
--- a/examples/stm32h7/src/bin/sdmmc.rs
+++ b/examples/stm32h7/src/bin/sdmmc.rs
@@ -3,7 +3,7 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::*; 5use defmt::*;
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy_stm32::sdmmc::Sdmmc; 7use embassy_stm32::sdmmc::Sdmmc;
8use embassy_stm32::time::mhz; 8use embassy_stm32::time::mhz;
9use embassy_stm32::{interrupt, Config, Peripherals}; 9use embassy_stm32::{interrupt, Config, Peripherals};
@@ -15,7 +15,7 @@ fn config() -> Config {
15 config 15 config
16} 16}
17 17
18#[embassy::main(config = "config()")] 18#[embassy_executor::main(config = "config()")]
19async fn main(_spawner: Spawner, p: Peripherals) -> ! { 19async fn main(_spawner: Spawner, p: Peripherals) -> ! {
20 info!("Hello World!"); 20 info!("Hello World!");
21 21
diff --git a/examples/stm32h7/src/bin/signal.rs b/examples/stm32h7/src/bin/signal.rs
index f798b1c92..2fc75c7af 100644
--- a/examples/stm32h7/src/bin/signal.rs
+++ b/examples/stm32h7/src/bin/signal.rs
@@ -3,15 +3,15 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::{info, unwrap}; 5use defmt::{info, unwrap};
6use embassy::channel::signal::Signal; 6use embassy_executor::executor::Spawner;
7use embassy::executor::Spawner; 7use embassy_executor::time::{Duration, Timer};
8use embassy::time::{Duration, Timer};
9use embassy_stm32::Peripherals; 8use embassy_stm32::Peripherals;
9use embassy_util::channel::signal::Signal;
10use {defmt_rtt as _, panic_probe as _}; 10use {defmt_rtt as _, panic_probe as _};
11 11
12static SIGNAL: Signal<u32> = Signal::new(); 12static SIGNAL: Signal<u32> = Signal::new();
13 13
14#[embassy::task] 14#[embassy_executor::task]
15async fn my_sending_task() { 15async fn my_sending_task() {
16 let mut counter: u32 = 0; 16 let mut counter: u32 = 0;
17 17
@@ -24,7 +24,7 @@ async fn my_sending_task() {
24 } 24 }
25} 25}
26 26
27#[embassy::main] 27#[embassy_executor::main]
28async fn main(spawner: Spawner, _p: Peripherals) { 28async fn main(spawner: Spawner, _p: Peripherals) {
29 unwrap!(spawner.spawn(my_sending_task())); 29 unwrap!(spawner.spawn(my_sending_task()));
30 30
diff --git a/examples/stm32h7/src/bin/spi.rs b/examples/stm32h7/src/bin/spi.rs
index f2eb5a3be..dc8cb7f47 100644
--- a/examples/stm32h7/src/bin/spi.rs
+++ b/examples/stm32h7/src/bin/spi.rs
@@ -7,12 +7,12 @@ use core::str::from_utf8;
7 7
8use cortex_m_rt::entry; 8use cortex_m_rt::entry;
9use defmt::*; 9use defmt::*;
10use embassy::executor::Executor; 10use embassy_executor::executor::Executor;
11use embassy::util::Forever;
12use embassy_stm32::dma::NoDma; 11use embassy_stm32::dma::NoDma;
13use embassy_stm32::peripherals::SPI3; 12use embassy_stm32::peripherals::SPI3;
14use embassy_stm32::time::mhz; 13use embassy_stm32::time::mhz;
15use embassy_stm32::{spi, Config}; 14use embassy_stm32::{spi, Config};
15use embassy_util::Forever;
16use heapless::String; 16use heapless::String;
17use {defmt_rtt as _, panic_probe as _}; 17use {defmt_rtt as _, panic_probe as _};
18 18
@@ -24,7 +24,7 @@ pub fn config() -> Config {
24 config 24 config
25} 25}
26 26
27#[embassy::task] 27#[embassy_executor::task]
28async fn main_task(mut spi: spi::Spi<'static, SPI3, NoDma, NoDma>) { 28async fn main_task(mut spi: spi::Spi<'static, SPI3, NoDma, NoDma>) {
29 for n in 0u32.. { 29 for n in 0u32.. {
30 let mut write: String<128> = String::new(); 30 let mut write: String<128> = String::new();
diff --git a/examples/stm32h7/src/bin/spi_dma.rs b/examples/stm32h7/src/bin/spi_dma.rs
index d72051fda..2631ed30c 100644
--- a/examples/stm32h7/src/bin/spi_dma.rs
+++ b/examples/stm32h7/src/bin/spi_dma.rs
@@ -7,11 +7,11 @@ use core::str::from_utf8;
7 7
8use cortex_m_rt::entry; 8use cortex_m_rt::entry;
9use defmt::*; 9use defmt::*;
10use embassy::executor::Executor; 10use embassy_executor::executor::Executor;
11use embassy::util::Forever;
12use embassy_stm32::peripherals::{DMA1_CH3, DMA1_CH4, SPI3}; 11use embassy_stm32::peripherals::{DMA1_CH3, DMA1_CH4, SPI3};
13use embassy_stm32::time::mhz; 12use embassy_stm32::time::mhz;
14use embassy_stm32::{spi, Config}; 13use embassy_stm32::{spi, Config};
14use embassy_util::Forever;
15use heapless::String; 15use heapless::String;
16use {defmt_rtt as _, panic_probe as _}; 16use {defmt_rtt as _, panic_probe as _};
17 17
@@ -23,7 +23,7 @@ pub fn config() -> Config {
23 config 23 config
24} 24}
25 25
26#[embassy::task] 26#[embassy_executor::task]
27async fn main_task(mut spi: spi::Spi<'static, SPI3, DMA1_CH3, DMA1_CH4>) { 27async fn main_task(mut spi: spi::Spi<'static, SPI3, DMA1_CH3, DMA1_CH4>) {
28 for n in 0u32.. { 28 for n in 0u32.. {
29 let mut write: String<128> = String::new(); 29 let mut write: String<128> = String::new();
diff --git a/examples/stm32h7/src/bin/usart.rs b/examples/stm32h7/src/bin/usart.rs
index fc3db5a33..e491fb39d 100644
--- a/examples/stm32h7/src/bin/usart.rs
+++ b/examples/stm32h7/src/bin/usart.rs
@@ -4,13 +4,13 @@
4 4
5use cortex_m_rt::entry; 5use cortex_m_rt::entry;
6use defmt::*; 6use defmt::*;
7use embassy::executor::Executor; 7use embassy_executor::executor::Executor;
8use embassy::util::Forever;
9use embassy_stm32::dma::NoDma; 8use embassy_stm32::dma::NoDma;
10use embassy_stm32::usart::{Config, Uart}; 9use embassy_stm32::usart::{Config, Uart};
10use embassy_util::Forever;
11use {defmt_rtt as _, panic_probe as _}; 11use {defmt_rtt as _, panic_probe as _};
12 12
13#[embassy::task] 13#[embassy_executor::task]
14async fn main_task() { 14async fn main_task() {
15 let p = embassy_stm32::init(Default::default()); 15 let p = embassy_stm32::init(Default::default());
16 16
diff --git a/examples/stm32h7/src/bin/usart_dma.rs b/examples/stm32h7/src/bin/usart_dma.rs
index d3325b0c1..aacda45bc 100644
--- a/examples/stm32h7/src/bin/usart_dma.rs
+++ b/examples/stm32h7/src/bin/usart_dma.rs
@@ -6,14 +6,14 @@ use core::fmt::Write;
6 6
7use cortex_m_rt::entry; 7use cortex_m_rt::entry;
8use defmt::*; 8use defmt::*;
9use embassy::executor::Executor; 9use embassy_executor::executor::Executor;
10use embassy::util::Forever;
11use embassy_stm32::dma::NoDma; 10use embassy_stm32::dma::NoDma;
12use embassy_stm32::usart::{Config, Uart}; 11use embassy_stm32::usart::{Config, Uart};
12use embassy_util::Forever;
13use heapless::String; 13use heapless::String;
14use {defmt_rtt as _, panic_probe as _}; 14use {defmt_rtt as _, panic_probe as _};
15 15
16#[embassy::task] 16#[embassy_executor::task]
17async fn main_task() { 17async fn main_task() {
18 let p = embassy_stm32::init(Default::default()); 18 let p = embassy_stm32::init(Default::default());
19 19
diff --git a/examples/stm32h7/src/bin/usart_split.rs b/examples/stm32h7/src/bin/usart_split.rs
index 678d8c911..12bb0ce9c 100644
--- a/examples/stm32h7/src/bin/usart_split.rs
+++ b/examples/stm32h7/src/bin/usart_split.rs
@@ -3,16 +3,16 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::*; 5use defmt::*;
6use embassy::blocking_mutex::raw::ThreadModeRawMutex; 6use embassy_executor::executor::Spawner;
7use embassy::channel::mpmc::Channel;
8use embassy::executor::Spawner;
9use embassy_stm32::dma::NoDma; 7use embassy_stm32::dma::NoDma;
10use embassy_stm32::peripherals::{DMA1_CH1, UART7}; 8use embassy_stm32::peripherals::{DMA1_CH1, UART7};
11use embassy_stm32::usart::{Config, Uart, UartRx}; 9use embassy_stm32::usart::{Config, Uart, UartRx};
12use embassy_stm32::Peripherals; 10use embassy_stm32::Peripherals;
11use embassy_util::blocking_mutex::raw::ThreadModeRawMutex;
12use embassy_util::channel::mpmc::Channel;
13use {defmt_rtt as _, panic_probe as _}; 13use {defmt_rtt as _, panic_probe as _};
14 14
15#[embassy::task] 15#[embassy_executor::task]
16async fn writer(mut usart: Uart<'static, UART7, NoDma, NoDma>) { 16async fn writer(mut usart: Uart<'static, UART7, NoDma, NoDma>) {
17 unwrap!(usart.blocking_write(b"Hello Embassy World!\r\n")); 17 unwrap!(usart.blocking_write(b"Hello Embassy World!\r\n"));
18 info!("wrote Hello, starting echo"); 18 info!("wrote Hello, starting echo");
@@ -26,7 +26,7 @@ async fn writer(mut usart: Uart<'static, UART7, NoDma, NoDma>) {
26 26
27static CHANNEL: Channel<ThreadModeRawMutex, [u8; 8], 1> = Channel::new(); 27static CHANNEL: Channel<ThreadModeRawMutex, [u8; 8], 1> = Channel::new();
28 28
29#[embassy::main] 29#[embassy_executor::main]
30async fn main(spawner: Spawner, p: Peripherals) -> ! { 30async fn main(spawner: Spawner, p: Peripherals) -> ! {
31 info!("Hello World!"); 31 info!("Hello World!");
32 32
@@ -45,7 +45,7 @@ async fn main(spawner: Spawner, p: Peripherals) -> ! {
45 } 45 }
46} 46}
47 47
48#[embassy::task] 48#[embassy_executor::task]
49async fn reader(mut rx: UartRx<'static, UART7, DMA1_CH1>) { 49async fn reader(mut rx: UartRx<'static, UART7, DMA1_CH1>) {
50 let mut buf = [0; 8]; 50 let mut buf = [0; 8];
51 loop { 51 loop {
diff --git a/examples/stm32l0/Cargo.toml b/examples/stm32l0/Cargo.toml
index d6093963b..7edda042d 100644
--- a/examples/stm32l0/Cargo.toml
+++ b/examples/stm32l0/Cargo.toml
@@ -8,7 +8,8 @@ default = ["nightly"]
8nightly = ["embassy-stm32/nightly", "embassy-lora", "lorawan-device", "lorawan", "embedded-io/async"] 8nightly = ["embassy-stm32/nightly", "embassy-lora", "lorawan-device", "lorawan", "embedded-io/async"]
9 9
10[dependencies] 10[dependencies]
11embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt", "defmt-timestamp-uptime", "time-tick-32768hz"] } 11embassy-util = { version = "0.1.0", path = "../../embassy-util", features = ["defmt"] }
12embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "defmt-timestamp-uptime", "time-tick-32768hz"] }
12embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["defmt", "stm32l072cz", "time-driver-any", "exti", "unstable-traits", "memory-x"] } 13embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["defmt", "stm32l072cz", "time-driver-any", "exti", "unstable-traits", "memory-x"] }
13embassy-lora = { version = "0.1.0", path = "../../embassy-lora", features = ["sx127x", "time", "defmt"], optional = true} 14embassy-lora = { version = "0.1.0", path = "../../embassy-lora", features = ["sx127x", "time", "defmt"], optional = true}
14 15
diff --git a/examples/stm32l0/src/bin/blinky.rs b/examples/stm32l0/src/bin/blinky.rs
index e027192bc..8cf21effb 100644
--- a/examples/stm32l0/src/bin/blinky.rs
+++ b/examples/stm32l0/src/bin/blinky.rs
@@ -3,13 +3,13 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::*; 5use defmt::*;
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy::time::{Duration, Timer}; 7use embassy_executor::time::{Duration, Timer};
8use embassy_stm32::gpio::{Level, Output, Speed}; 8use embassy_stm32::gpio::{Level, Output, Speed};
9use embassy_stm32::Peripherals; 9use embassy_stm32::Peripherals;
10use {defmt_rtt as _, panic_probe as _}; 10use {defmt_rtt as _, panic_probe as _};
11 11
12#[embassy::main] 12#[embassy_executor::main]
13async fn main(_spawner: Spawner, p: Peripherals) { 13async fn main(_spawner: Spawner, p: Peripherals) {
14 info!("Hello World!"); 14 info!("Hello World!");
15 15
diff --git a/examples/stm32l0/src/bin/button.rs b/examples/stm32l0/src/bin/button.rs
index 43ea8c2a5..a5e05c3a3 100644
--- a/examples/stm32l0/src/bin/button.rs
+++ b/examples/stm32l0/src/bin/button.rs
@@ -3,12 +3,12 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::*; 5use defmt::*;
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy_stm32::gpio::{Input, Level, Output, Pull, Speed}; 7use embassy_stm32::gpio::{Input, Level, Output, Pull, Speed};
8use embassy_stm32::Peripherals; 8use embassy_stm32::Peripherals;
9use {defmt_rtt as _, panic_probe as _}; 9use {defmt_rtt as _, panic_probe as _};
10 10
11#[embassy::main] 11#[embassy_executor::main]
12async fn main(_spawner: Spawner, p: Peripherals) { 12async fn main(_spawner: Spawner, p: Peripherals) {
13 info!("Hello World!"); 13 info!("Hello World!");
14 14
diff --git a/examples/stm32l0/src/bin/button_exti.rs b/examples/stm32l0/src/bin/button_exti.rs
index d87870a01..22a096af8 100644
--- a/examples/stm32l0/src/bin/button_exti.rs
+++ b/examples/stm32l0/src/bin/button_exti.rs
@@ -3,7 +3,7 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::*; 5use defmt::*;
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy_stm32::exti::ExtiInput; 7use embassy_stm32::exti::ExtiInput;
8use embassy_stm32::gpio::{Input, Pull}; 8use embassy_stm32::gpio::{Input, Pull};
9use embassy_stm32::Peripherals; 9use embassy_stm32::Peripherals;
@@ -15,7 +15,7 @@ fn config() -> embassy_stm32::Config {
15 config 15 config
16} 16}
17 17
18#[embassy::main(config = "config()")] 18#[embassy_executor::main(config = "config()")]
19async fn main(_spawner: Spawner, p: Peripherals) { 19async fn main(_spawner: Spawner, p: Peripherals) {
20 let button = Input::new(p.PB2, Pull::Up); 20 let button = Input::new(p.PB2, Pull::Up);
21 let mut button = ExtiInput::new(button, p.EXTI2); 21 let mut button = ExtiInput::new(button, p.EXTI2);
diff --git a/examples/stm32l0/src/bin/flash.rs b/examples/stm32l0/src/bin/flash.rs
index a2fec9291..7ad5ae3aa 100644
--- a/examples/stm32l0/src/bin/flash.rs
+++ b/examples/stm32l0/src/bin/flash.rs
@@ -3,13 +3,13 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::{info, unwrap}; 5use defmt::{info, unwrap};
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy_stm32::flash::Flash; 7use embassy_stm32::flash::Flash;
8use embassy_stm32::Peripherals; 8use embassy_stm32::Peripherals;
9use embedded_storage::nor_flash::{NorFlash, ReadNorFlash}; 9use embedded_storage::nor_flash::{NorFlash, ReadNorFlash};
10use {defmt_rtt as _, panic_probe as _}; 10use {defmt_rtt as _, panic_probe as _};
11 11
12#[embassy::main] 12#[embassy_executor::main]
13async fn main(_spawner: Spawner, p: Peripherals) { 13async fn main(_spawner: Spawner, p: Peripherals) {
14 info!("Hello Flash!"); 14 info!("Hello Flash!");
15 15
diff --git a/examples/stm32l0/src/bin/lorawan.rs b/examples/stm32l0/src/bin/lorawan.rs
index da58e2f72..29e54c1be 100644
--- a/examples/stm32l0/src/bin/lorawan.rs
+++ b/examples/stm32l0/src/bin/lorawan.rs
@@ -24,8 +24,8 @@ fn config() -> embassy_stm32::Config {
24 config 24 config
25} 25}
26 26
27#[embassy::main(config = "config()")] 27#[embassy_executor::main(config = "config()")]
28async fn main(_spawner: embassy::executor::Spawner, p: Peripherals) { 28async fn main(_spawner: embassy_executor::executor::Spawner, p: Peripherals) {
29 // SPI for sx127x 29 // SPI for sx127x
30 let spi = spi::Spi::new( 30 let spi = spi::Spi::new(
31 p.SPI1, 31 p.SPI1,
diff --git a/examples/stm32l0/src/bin/raw_spawn.rs b/examples/stm32l0/src/bin/raw_spawn.rs
index dfe2cddb6..cd711a430 100644
--- a/examples/stm32l0/src/bin/raw_spawn.rs
+++ b/examples/stm32l0/src/bin/raw_spawn.rs
@@ -5,10 +5,10 @@ use core::mem;
5 5
6use cortex_m_rt::entry; 6use cortex_m_rt::entry;
7use defmt::*; 7use defmt::*;
8use embassy::executor::raw::TaskStorage; 8use embassy_executor::executor::raw::TaskStorage;
9use embassy::executor::Executor; 9use embassy_executor::executor::Executor;
10use embassy::time::{Duration, Timer}; 10use embassy_executor::time::{Duration, Timer};
11use embassy::util::Forever; 11use embassy_util::Forever;
12use {defmt_rtt as _, panic_probe as _}; 12use {defmt_rtt as _, panic_probe as _};
13 13
14async fn run1() { 14async fn run1() {
diff --git a/examples/stm32l0/src/bin/spi.rs b/examples/stm32l0/src/bin/spi.rs
index dba0b281d..74694295c 100644
--- a/examples/stm32l0/src/bin/spi.rs
+++ b/examples/stm32l0/src/bin/spi.rs
@@ -3,7 +3,7 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::*; 5use defmt::*;
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy_stm32::dma::NoDma; 7use embassy_stm32::dma::NoDma;
8use embassy_stm32::gpio::{Level, Output, Speed}; 8use embassy_stm32::gpio::{Level, Output, Speed};
9use embassy_stm32::spi::{Config, Spi}; 9use embassy_stm32::spi::{Config, Spi};
@@ -11,7 +11,7 @@ use embassy_stm32::time::Hertz;
11use embassy_stm32::Peripherals; 11use embassy_stm32::Peripherals;
12use {defmt_rtt as _, panic_probe as _}; 12use {defmt_rtt as _, panic_probe as _};
13 13
14#[embassy::main] 14#[embassy_executor::main]
15async fn main(_spawner: Spawner, p: Peripherals) { 15async fn main(_spawner: Spawner, p: Peripherals) {
16 info!("Hello World, folks!"); 16 info!("Hello World, folks!");
17 17
diff --git a/examples/stm32l0/src/bin/usart_dma.rs b/examples/stm32l0/src/bin/usart_dma.rs
index 861241639..1c5ce94d7 100644
--- a/examples/stm32l0/src/bin/usart_dma.rs
+++ b/examples/stm32l0/src/bin/usart_dma.rs
@@ -3,12 +3,12 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::*; 5use defmt::*;
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy_stm32::usart::{Config, Uart}; 7use embassy_stm32::usart::{Config, Uart};
8use embassy_stm32::Peripherals; 8use embassy_stm32::Peripherals;
9use {defmt_rtt as _, panic_probe as _}; 9use {defmt_rtt as _, panic_probe as _};
10 10
11#[embassy::main] 11#[embassy_executor::main]
12async fn main(_spawner: Spawner, p: Peripherals) { 12async fn main(_spawner: Spawner, p: Peripherals) {
13 let mut usart = Uart::new(p.USART1, p.PB7, p.PB6, p.DMA1_CH2, p.DMA1_CH3, Config::default()); 13 let mut usart = Uart::new(p.USART1, p.PB7, p.PB6, p.DMA1_CH2, p.DMA1_CH3, Config::default());
14 14
diff --git a/examples/stm32l0/src/bin/usart_irq.rs b/examples/stm32l0/src/bin/usart_irq.rs
index 09b1b0b03..b77d97f85 100644
--- a/examples/stm32l0/src/bin/usart_irq.rs
+++ b/examples/stm32l0/src/bin/usart_irq.rs
@@ -3,14 +3,14 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::*; 5use defmt::*;
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy_stm32::dma::NoDma; 7use embassy_stm32::dma::NoDma;
8use embassy_stm32::usart::{BufferedUart, Config, State, Uart}; 8use embassy_stm32::usart::{BufferedUart, Config, State, Uart};
9use embassy_stm32::{interrupt, Peripherals}; 9use embassy_stm32::{interrupt, Peripherals};
10use embedded_io::asynch::{Read, Write}; 10use embedded_io::asynch::{Read, Write};
11use {defmt_rtt as _, panic_probe as _}; 11use {defmt_rtt as _, panic_probe as _};
12 12
13#[embassy::main] 13#[embassy_executor::main]
14async fn main(_spawner: Spawner, p: Peripherals) { 14async fn main(_spawner: Spawner, p: Peripherals) {
15 info!("Hi!"); 15 info!("Hi!");
16 16
diff --git a/examples/stm32l1/Cargo.toml b/examples/stm32l1/Cargo.toml
index 7fec60575..d69de9c53 100644
--- a/examples/stm32l1/Cargo.toml
+++ b/examples/stm32l1/Cargo.toml
@@ -4,7 +4,8 @@ name = "embassy-stm32l1-examples"
4version = "0.1.0" 4version = "0.1.0"
5 5
6[dependencies] 6[dependencies]
7embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt", "defmt-timestamp-uptime", "time-tick-32768hz"] } 7embassy-util = { version = "0.1.0", path = "../../embassy-util", features = ["defmt"] }
8embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "defmt-timestamp-uptime", "time-tick-32768hz"] }
8embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32l151cb-a", "time-driver-any", "memory-x"] } 9embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32l151cb-a", "time-driver-any", "memory-x"] }
9 10
10defmt = "0.3" 11defmt = "0.3"
diff --git a/examples/stm32l1/src/bin/blinky.rs b/examples/stm32l1/src/bin/blinky.rs
index bace53d91..58306be94 100644
--- a/examples/stm32l1/src/bin/blinky.rs
+++ b/examples/stm32l1/src/bin/blinky.rs
@@ -3,13 +3,13 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::*; 5use defmt::*;
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy::time::{Duration, Timer}; 7use embassy_executor::time::{Duration, Timer};
8use embassy_stm32::gpio::{Level, Output, Speed}; 8use embassy_stm32::gpio::{Level, Output, Speed};
9use embassy_stm32::Peripherals; 9use embassy_stm32::Peripherals;
10use {defmt_rtt as _, panic_probe as _}; 10use {defmt_rtt as _, panic_probe as _};
11 11
12#[embassy::main] 12#[embassy_executor::main]
13async fn main(_spawner: Spawner, p: Peripherals) { 13async fn main(_spawner: Spawner, p: Peripherals) {
14 info!("Hello World!"); 14 info!("Hello World!");
15 15
diff --git a/examples/stm32l1/src/bin/flash.rs b/examples/stm32l1/src/bin/flash.rs
index fc519b079..78938fe3e 100644
--- a/examples/stm32l1/src/bin/flash.rs
+++ b/examples/stm32l1/src/bin/flash.rs
@@ -3,13 +3,13 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::{info, unwrap}; 5use defmt::{info, unwrap};
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy_stm32::flash::Flash; 7use embassy_stm32::flash::Flash;
8use embassy_stm32::Peripherals; 8use embassy_stm32::Peripherals;
9use embedded_storage::nor_flash::{NorFlash, ReadNorFlash}; 9use embedded_storage::nor_flash::{NorFlash, ReadNorFlash};
10use {defmt_rtt as _, panic_probe as _}; 10use {defmt_rtt as _, panic_probe as _};
11 11
12#[embassy::main] 12#[embassy_executor::main]
13async fn main(_spawner: Spawner, p: Peripherals) { 13async fn main(_spawner: Spawner, p: Peripherals) {
14 info!("Hello Flash!"); 14 info!("Hello Flash!");
15 15
diff --git a/examples/stm32l1/src/bin/spi.rs b/examples/stm32l1/src/bin/spi.rs
index 81ccba4e1..05e869e71 100644
--- a/examples/stm32l1/src/bin/spi.rs
+++ b/examples/stm32l1/src/bin/spi.rs
@@ -3,7 +3,7 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::*; 5use defmt::*;
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy_stm32::dma::NoDma; 7use embassy_stm32::dma::NoDma;
8use embassy_stm32::gpio::{Level, Output, Speed}; 8use embassy_stm32::gpio::{Level, Output, Speed};
9use embassy_stm32::spi::{Config, Spi}; 9use embassy_stm32::spi::{Config, Spi};
@@ -11,7 +11,7 @@ use embassy_stm32::time::Hertz;
11use embassy_stm32::Peripherals; 11use embassy_stm32::Peripherals;
12use {defmt_rtt as _, panic_probe as _}; 12use {defmt_rtt as _, panic_probe as _};
13 13
14#[embassy::main] 14#[embassy_executor::main]
15async fn main(_spawner: Spawner, p: Peripherals) { 15async fn main(_spawner: Spawner, p: Peripherals) {
16 info!("Hello World, folks!"); 16 info!("Hello World, folks!");
17 17
diff --git a/examples/stm32l4/Cargo.toml b/examples/stm32l4/Cargo.toml
index 7d89bf94a..8ac974c92 100644
--- a/examples/stm32l4/Cargo.toml
+++ b/examples/stm32l4/Cargo.toml
@@ -6,7 +6,8 @@ version = "0.1.0"
6[features] 6[features]
7 7
8[dependencies] 8[dependencies]
9embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt", "defmt-timestamp-uptime", "time-tick-32768hz"] } 9embassy-util = { version = "0.1.0", path = "../../embassy-util", features = ["defmt"] }
10embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "defmt-timestamp-uptime", "time-tick-32768hz"] }
10embassy-embedded-hal = { version = "0.1.0", path = "../../embassy-embedded-hal" } 11embassy-embedded-hal = { version = "0.1.0", path = "../../embassy-embedded-hal" }
11embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "unstable-pac", "stm32l4s5vi", "time-driver-any", "exti", "unstable-traits"] } 12embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "unstable-pac", "stm32l4s5vi", "time-driver-any", "exti", "unstable-traits"] }
12 13
diff --git a/examples/stm32l4/src/bin/adc.rs b/examples/stm32l4/src/bin/adc.rs
index 499ea47dc..93a20d5ea 100644
--- a/examples/stm32l4/src/bin/adc.rs
+++ b/examples/stm32l4/src/bin/adc.rs
@@ -3,7 +3,7 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::*; 5use defmt::*;
6use embassy::time::Delay; 6use embassy_executor::time::Delay;
7use embassy_stm32::adc::{Adc, Resolution}; 7use embassy_stm32::adc::{Adc, Resolution};
8use embassy_stm32::pac; 8use embassy_stm32::pac;
9use {defmt_rtt as _, panic_probe as _}; 9use {defmt_rtt as _, panic_probe as _};
diff --git a/examples/stm32l4/src/bin/blinky.rs b/examples/stm32l4/src/bin/blinky.rs
index 54f8e03b2..3d689b5ee 100644
--- a/examples/stm32l4/src/bin/blinky.rs
+++ b/examples/stm32l4/src/bin/blinky.rs
@@ -3,13 +3,13 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::*; 5use defmt::*;
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy::time::{Duration, Timer}; 7use embassy_executor::time::{Duration, Timer};
8use embassy_stm32::gpio::{Level, Output, Speed}; 8use embassy_stm32::gpio::{Level, Output, Speed};
9use embassy_stm32::Peripherals; 9use embassy_stm32::Peripherals;
10use {defmt_rtt as _, panic_probe as _}; 10use {defmt_rtt as _, panic_probe as _};
11 11
12#[embassy::main] 12#[embassy_executor::main]
13async fn main(_spawner: Spawner, p: Peripherals) { 13async fn main(_spawner: Spawner, p: Peripherals) {
14 info!("Hello World!"); 14 info!("Hello World!");
15 15
diff --git a/examples/stm32l4/src/bin/button_exti.rs b/examples/stm32l4/src/bin/button_exti.rs
index 924feeb33..0832386ed 100644
--- a/examples/stm32l4/src/bin/button_exti.rs
+++ b/examples/stm32l4/src/bin/button_exti.rs
@@ -3,13 +3,13 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::*; 5use defmt::*;
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy_stm32::exti::ExtiInput; 7use embassy_stm32::exti::ExtiInput;
8use embassy_stm32::gpio::{Input, Pull}; 8use embassy_stm32::gpio::{Input, Pull};
9use embassy_stm32::Peripherals; 9use embassy_stm32::Peripherals;
10use {defmt_rtt as _, panic_probe as _}; 10use {defmt_rtt as _, panic_probe as _};
11 11
12#[embassy::main] 12#[embassy_executor::main]
13async fn main(_spawner: Spawner, p: Peripherals) { 13async fn main(_spawner: Spawner, p: Peripherals) {
14 info!("Hello World!"); 14 info!("Hello World!");
15 15
diff --git a/examples/stm32l4/src/bin/i2c.rs b/examples/stm32l4/src/bin/i2c.rs
index a22b52184..058529ecf 100644
--- a/examples/stm32l4/src/bin/i2c.rs
+++ b/examples/stm32l4/src/bin/i2c.rs
@@ -3,7 +3,7 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::*; 5use defmt::*;
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy_stm32::dma::NoDma; 7use embassy_stm32::dma::NoDma;
8use embassy_stm32::i2c::I2c; 8use embassy_stm32::i2c::I2c;
9use embassy_stm32::time::Hertz; 9use embassy_stm32::time::Hertz;
@@ -13,7 +13,7 @@ use {defmt_rtt as _, panic_probe as _};
13const ADDRESS: u8 = 0x5F; 13const ADDRESS: u8 = 0x5F;
14const WHOAMI: u8 = 0x0F; 14const WHOAMI: u8 = 0x0F;
15 15
16#[embassy::main] 16#[embassy_executor::main]
17async fn main(_spawner: Spawner, p: Peripherals) -> ! { 17async fn main(_spawner: Spawner, p: Peripherals) -> ! {
18 let irq = interrupt::take!(I2C2_EV); 18 let irq = interrupt::take!(I2C2_EV);
19 let mut i2c = I2c::new(p.I2C2, p.PB10, p.PB11, irq, NoDma, NoDma, Hertz(100_000)); 19 let mut i2c = I2c::new(p.I2C2, p.PB10, p.PB11, irq, NoDma, NoDma, Hertz(100_000));
diff --git a/examples/stm32l4/src/bin/i2c_blocking_async.rs b/examples/stm32l4/src/bin/i2c_blocking_async.rs
index 6c4a86703..2dae9c2d5 100644
--- a/examples/stm32l4/src/bin/i2c_blocking_async.rs
+++ b/examples/stm32l4/src/bin/i2c_blocking_async.rs
@@ -3,8 +3,8 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::*; 5use defmt::*;
6use embassy::executor::Spawner;
7use embassy_embedded_hal::adapter::BlockingAsync; 6use embassy_embedded_hal::adapter::BlockingAsync;
7use embassy_executor::executor::Spawner;
8use embassy_stm32::dma::NoDma; 8use embassy_stm32::dma::NoDma;
9use embassy_stm32::i2c::I2c; 9use embassy_stm32::i2c::I2c;
10use embassy_stm32::time::Hertz; 10use embassy_stm32::time::Hertz;
@@ -15,7 +15,7 @@ use {defmt_rtt as _, panic_probe as _};
15const ADDRESS: u8 = 0x5F; 15const ADDRESS: u8 = 0x5F;
16const WHOAMI: u8 = 0x0F; 16const WHOAMI: u8 = 0x0F;
17 17
18#[embassy::main] 18#[embassy_executor::main]
19async fn main(_spawner: Spawner, p: Peripherals) -> ! { 19async fn main(_spawner: Spawner, p: Peripherals) -> ! {
20 let irq = interrupt::take!(I2C2_EV); 20 let irq = interrupt::take!(I2C2_EV);
21 let i2c = I2c::new(p.I2C2, p.PB10, p.PB11, irq, NoDma, NoDma, Hertz(100_000)); 21 let i2c = I2c::new(p.I2C2, p.PB10, p.PB11, irq, NoDma, NoDma, Hertz(100_000));
diff --git a/examples/stm32l4/src/bin/i2c_dma.rs b/examples/stm32l4/src/bin/i2c_dma.rs
index 48d2e92cf..9e71d404b 100644
--- a/examples/stm32l4/src/bin/i2c_dma.rs
+++ b/examples/stm32l4/src/bin/i2c_dma.rs
@@ -3,7 +3,7 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::*; 5use defmt::*;
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy_stm32::i2c::I2c; 7use embassy_stm32::i2c::I2c;
8use embassy_stm32::time::Hertz; 8use embassy_stm32::time::Hertz;
9use embassy_stm32::{interrupt, Peripherals}; 9use embassy_stm32::{interrupt, Peripherals};
@@ -12,7 +12,7 @@ use {defmt_rtt as _, panic_probe as _};
12const ADDRESS: u8 = 0x5F; 12const ADDRESS: u8 = 0x5F;
13const WHOAMI: u8 = 0x0F; 13const WHOAMI: u8 = 0x0F;
14 14
15#[embassy::main] 15#[embassy_executor::main]
16async fn main(_spawner: Spawner, p: Peripherals) -> ! { 16async fn main(_spawner: Spawner, p: Peripherals) -> ! {
17 let irq = interrupt::take!(I2C2_EV); 17 let irq = interrupt::take!(I2C2_EV);
18 let mut i2c = I2c::new(p.I2C2, p.PB10, p.PB11, irq, p.DMA1_CH4, p.DMA1_CH5, Hertz(100_000)); 18 let mut i2c = I2c::new(p.I2C2, p.PB10, p.PB11, irq, p.DMA1_CH4, p.DMA1_CH5, Hertz(100_000));
diff --git a/examples/stm32l4/src/bin/rng.rs b/examples/stm32l4/src/bin/rng.rs
index 7aaa122ed..ed47fc6c9 100644
--- a/examples/stm32l4/src/bin/rng.rs
+++ b/examples/stm32l4/src/bin/rng.rs
@@ -3,7 +3,7 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::*; 5use defmt::*;
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy_stm32::rcc::{ClockSrc, PLLClkDiv, PLLMul, PLLSource, PLLSrcDiv}; 7use embassy_stm32::rcc::{ClockSrc, PLLClkDiv, PLLMul, PLLSource, PLLSrcDiv};
8use embassy_stm32::rng::Rng; 8use embassy_stm32::rng::Rng;
9use embassy_stm32::{Config, Peripherals}; 9use embassy_stm32::{Config, Peripherals};
@@ -22,7 +22,7 @@ fn config() -> Config {
22 config 22 config
23} 23}
24 24
25#[embassy::main(config = "config()")] 25#[embassy_executor::main(config = "config()")]
26async fn main(_spawner: Spawner, p: Peripherals) { 26async fn main(_spawner: Spawner, p: Peripherals) {
27 info!("Hello World!"); 27 info!("Hello World!");
28 28
diff --git a/examples/stm32l4/src/bin/spi_blocking_async.rs b/examples/stm32l4/src/bin/spi_blocking_async.rs
index 20a2ff802..e06b29b81 100644
--- a/examples/stm32l4/src/bin/spi_blocking_async.rs
+++ b/examples/stm32l4/src/bin/spi_blocking_async.rs
@@ -3,8 +3,8 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::*; 5use defmt::*;
6use embassy::executor::Spawner;
7use embassy_embedded_hal::adapter::BlockingAsync; 6use embassy_embedded_hal::adapter::BlockingAsync;
7use embassy_executor::executor::Spawner;
8use embassy_stm32::dma::NoDma; 8use embassy_stm32::dma::NoDma;
9use embassy_stm32::gpio::{Input, Level, Output, Pull, Speed}; 9use embassy_stm32::gpio::{Input, Level, Output, Pull, Speed};
10use embassy_stm32::spi::{Config, Spi}; 10use embassy_stm32::spi::{Config, Spi};
@@ -13,7 +13,7 @@ use embassy_stm32::Peripherals;
13use embedded_hal_async::spi::SpiBus; 13use embedded_hal_async::spi::SpiBus;
14use {defmt_rtt as _, panic_probe as _}; 14use {defmt_rtt as _, panic_probe as _};
15 15
16#[embassy::main] 16#[embassy_executor::main]
17async fn main(_spawner: Spawner, p: Peripherals) { 17async fn main(_spawner: Spawner, p: Peripherals) {
18 info!("Hello World!"); 18 info!("Hello World!");
19 19
diff --git a/examples/stm32l4/src/bin/spi_dma.rs b/examples/stm32l4/src/bin/spi_dma.rs
index d0c3609af..e44754bec 100644
--- a/examples/stm32l4/src/bin/spi_dma.rs
+++ b/examples/stm32l4/src/bin/spi_dma.rs
@@ -3,14 +3,14 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::*; 5use defmt::*;
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy_stm32::gpio::{Input, Level, Output, Pull, Speed}; 7use embassy_stm32::gpio::{Input, Level, Output, Pull, Speed};
8use embassy_stm32::spi::{Config, Spi}; 8use embassy_stm32::spi::{Config, Spi};
9use embassy_stm32::time::Hertz; 9use embassy_stm32::time::Hertz;
10use embassy_stm32::Peripherals; 10use embassy_stm32::Peripherals;
11use {defmt_rtt as _, panic_probe as _}; 11use {defmt_rtt as _, panic_probe as _};
12 12
13#[embassy::main] 13#[embassy_executor::main]
14async fn main(_spawner: Spawner, p: Peripherals) { 14async fn main(_spawner: Spawner, p: Peripherals) {
15 info!("Hello World!"); 15 info!("Hello World!");
16 16
diff --git a/examples/stm32l4/src/bin/usart_dma.rs b/examples/stm32l4/src/bin/usart_dma.rs
index 7ae7e9e15..fdd5a85e6 100644
--- a/examples/stm32l4/src/bin/usart_dma.rs
+++ b/examples/stm32l4/src/bin/usart_dma.rs
@@ -5,14 +5,14 @@
5use core::fmt::Write; 5use core::fmt::Write;
6 6
7use defmt::*; 7use defmt::*;
8use embassy::executor::Spawner; 8use embassy_executor::executor::Spawner;
9use embassy_stm32::dma::NoDma; 9use embassy_stm32::dma::NoDma;
10use embassy_stm32::usart::{Config, Uart}; 10use embassy_stm32::usart::{Config, Uart};
11use embassy_stm32::Peripherals; 11use embassy_stm32::Peripherals;
12use heapless::String; 12use heapless::String;
13use {defmt_rtt as _, panic_probe as _}; 13use {defmt_rtt as _, panic_probe as _};
14 14
15#[embassy::main] 15#[embassy_executor::main]
16async fn main(_spawner: Spawner, p: Peripherals) { 16async fn main(_spawner: Spawner, p: Peripherals) {
17 info!("Hello World!"); 17 info!("Hello World!");
18 18
diff --git a/examples/stm32l5/Cargo.toml b/examples/stm32l5/Cargo.toml
index 85eac7b8f..6466994ed 100644
--- a/examples/stm32l5/Cargo.toml
+++ b/examples/stm32l5/Cargo.toml
@@ -6,7 +6,8 @@ version = "0.1.0"
6[features] 6[features]
7 7
8[dependencies] 8[dependencies]
9embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt", "defmt-timestamp-uptime", "time-tick-32768hz"] } 9embassy-util = { version = "0.1.0", path = "../../embassy-util", features = ["defmt"] }
10embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "defmt-timestamp-uptime", "time-tick-32768hz"] }
10embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "unstable-pac", "stm32l552ze", "time-driver-any", "exti", "unstable-traits", "memory-x"] } 11embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "unstable-pac", "stm32l552ze", "time-driver-any", "exti", "unstable-traits", "memory-x"] }
11embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } 12embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] }
12embassy-usb-serial = { version = "0.1.0", path = "../../embassy-usb-serial", features = ["defmt"] } 13embassy-usb-serial = { version = "0.1.0", path = "../../embassy-usb-serial", features = ["defmt"] }
diff --git a/examples/stm32l5/src/bin/button_exti.rs b/examples/stm32l5/src/bin/button_exti.rs
index c7a6cfa28..99462e597 100644
--- a/examples/stm32l5/src/bin/button_exti.rs
+++ b/examples/stm32l5/src/bin/button_exti.rs
@@ -3,13 +3,13 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::*; 5use defmt::*;
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy_stm32::exti::ExtiInput; 7use embassy_stm32::exti::ExtiInput;
8use embassy_stm32::gpio::{Input, Pull}; 8use embassy_stm32::gpio::{Input, Pull};
9use embassy_stm32::Peripherals; 9use embassy_stm32::Peripherals;
10use {defmt_rtt as _, panic_probe as _}; 10use {defmt_rtt as _, panic_probe as _};
11 11
12#[embassy::main] 12#[embassy_executor::main]
13async fn main(_spawner: Spawner, p: Peripherals) { 13async fn main(_spawner: Spawner, p: Peripherals) {
14 info!("Hello World!"); 14 info!("Hello World!");
15 15
diff --git a/examples/stm32l5/src/bin/rng.rs b/examples/stm32l5/src/bin/rng.rs
index d3627d2c2..45094374b 100644
--- a/examples/stm32l5/src/bin/rng.rs
+++ b/examples/stm32l5/src/bin/rng.rs
@@ -3,7 +3,7 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::*; 5use defmt::*;
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy_stm32::rcc::{ClockSrc, PLLClkDiv, PLLMul, PLLSource, PLLSrcDiv}; 7use embassy_stm32::rcc::{ClockSrc, PLLClkDiv, PLLMul, PLLSource, PLLSrcDiv};
8use embassy_stm32::rng::Rng; 8use embassy_stm32::rng::Rng;
9use embassy_stm32::{Config, Peripherals}; 9use embassy_stm32::{Config, Peripherals};
@@ -21,7 +21,7 @@ fn config() -> Config {
21 config 21 config
22} 22}
23 23
24#[embassy::main(config = "config()")] 24#[embassy_executor::main(config = "config()")]
25async fn main(_spawner: Spawner, p: Peripherals) { 25async fn main(_spawner: Spawner, p: Peripherals) {
26 info!("Hello World!"); 26 info!("Hello World!");
27 27
diff --git a/examples/stm32l5/src/bin/usb_ethernet.rs b/examples/stm32l5/src/bin/usb_ethernet.rs
index d711616ef..9e1df15dd 100644
--- a/examples/stm32l5/src/bin/usb_ethernet.rs
+++ b/examples/stm32l5/src/bin/usb_ethernet.rs
@@ -7,10 +7,7 @@ use core::sync::atomic::{AtomicBool, Ordering};
7use core::task::Waker; 7use core::task::Waker;
8 8
9use defmt::*; 9use defmt::*;
10use embassy::blocking_mutex::raw::ThreadModeRawMutex; 10use embassy_executor::executor::Spawner;
11use embassy::channel::mpmc::Channel;
12use embassy::executor::Spawner;
13use embassy::util::Forever;
14use embassy_net::tcp::TcpSocket; 11use embassy_net::tcp::TcpSocket;
15use embassy_net::{PacketBox, PacketBoxExt, PacketBuf, Stack, StackResources}; 12use embassy_net::{PacketBox, PacketBoxExt, PacketBuf, Stack, StackResources};
16use embassy_stm32::rcc::*; 13use embassy_stm32::rcc::*;
@@ -20,6 +17,9 @@ use embassy_stm32::usb::Driver;
20use embassy_stm32::{interrupt, Config, Peripherals}; 17use embassy_stm32::{interrupt, Config, Peripherals};
21use embassy_usb::{Builder, UsbDevice}; 18use embassy_usb::{Builder, UsbDevice};
22use embassy_usb_ncm::{CdcNcmClass, Receiver, Sender, State}; 19use embassy_usb_ncm::{CdcNcmClass, Receiver, Sender, State};
20use embassy_util::blocking_mutex::raw::ThreadModeRawMutex;
21use embassy_util::channel::mpmc::Channel;
22use embassy_util::Forever;
23use embedded_io::asynch::{Read, Write}; 23use embedded_io::asynch::{Read, Write};
24use rand_core::RngCore; 24use rand_core::RngCore;
25use {defmt_rtt as _, panic_probe as _}; 25use {defmt_rtt as _, panic_probe as _};
@@ -34,12 +34,12 @@ macro_rules! forever {
34 }}; 34 }};
35} 35}
36 36
37#[embassy::task] 37#[embassy_executor::task]
38async fn usb_task(mut device: UsbDevice<'static, MyDriver>) -> ! { 38async fn usb_task(mut device: UsbDevice<'static, MyDriver>) -> ! {
39 device.run().await 39 device.run().await
40} 40}
41 41
42#[embassy::task] 42#[embassy_executor::task]
43async fn usb_ncm_rx_task(mut class: Receiver<'static, MyDriver>) { 43async fn usb_ncm_rx_task(mut class: Receiver<'static, MyDriver>) {
44 loop { 44 loop {
45 warn!("WAITING for connection"); 45 warn!("WAITING for connection");
@@ -68,7 +68,7 @@ async fn usb_ncm_rx_task(mut class: Receiver<'static, MyDriver>) {
68 } 68 }
69} 69}
70 70
71#[embassy::task] 71#[embassy_executor::task]
72async fn usb_ncm_tx_task(mut class: Sender<'static, MyDriver>) { 72async fn usb_ncm_tx_task(mut class: Sender<'static, MyDriver>) {
73 loop { 73 loop {
74 let pkt = TX_CHANNEL.recv().await; 74 let pkt = TX_CHANNEL.recv().await;
@@ -78,7 +78,7 @@ async fn usb_ncm_tx_task(mut class: Sender<'static, MyDriver>) {
78 } 78 }
79} 79}
80 80
81#[embassy::task] 81#[embassy_executor::task]
82async fn net_task(stack: &'static Stack<Device>) -> ! { 82async fn net_task(stack: &'static Stack<Device>) -> ! {
83 stack.run().await 83 stack.run().await
84} 84}
@@ -93,7 +93,7 @@ fn config() -> Config {
93 config 93 config
94} 94}
95 95
96#[embassy::main(config = "config()")] 96#[embassy_executor::main(config = "config()")]
97async fn main(spawner: Spawner, p: Peripherals) { 97async fn main(spawner: Spawner, p: Peripherals) {
98 // Create the driver, from the HAL. 98 // Create the driver, from the HAL.
99 let irq = interrupt::take!(USB_FS); 99 let irq = interrupt::take!(USB_FS);
diff --git a/examples/stm32l5/src/bin/usb_hid_mouse.rs b/examples/stm32l5/src/bin/usb_hid_mouse.rs
index d139e6bb1..6aac00881 100644
--- a/examples/stm32l5/src/bin/usb_hid_mouse.rs
+++ b/examples/stm32l5/src/bin/usb_hid_mouse.rs
@@ -4,8 +4,8 @@
4#![feature(type_alias_impl_trait)] 4#![feature(type_alias_impl_trait)]
5 5
6use defmt::*; 6use defmt::*;
7use embassy::executor::Spawner; 7use embassy_executor::executor::Spawner;
8use embassy::time::{Duration, Timer}; 8use embassy_executor::time::{Duration, Timer};
9use embassy_stm32::rcc::*; 9use embassy_stm32::rcc::*;
10use embassy_stm32::time::Hertz; 10use embassy_stm32::time::Hertz;
11use embassy_stm32::usb::Driver; 11use embassy_stm32::usb::Driver;
@@ -27,7 +27,7 @@ fn config() -> Config {
27 config 27 config
28} 28}
29 29
30#[embassy::main(config = "config()")] 30#[embassy_executor::main(config = "config()")]
31async fn main(_spawner: Spawner, p: Peripherals) { 31async fn main(_spawner: Spawner, p: Peripherals) {
32 // Create the driver, from the HAL. 32 // Create the driver, from the HAL.
33 let irq = interrupt::take!(USB_FS); 33 let irq = interrupt::take!(USB_FS);
diff --git a/examples/stm32l5/src/bin/usb_serial.rs b/examples/stm32l5/src/bin/usb_serial.rs
index 8dab001c6..508bce8a8 100644
--- a/examples/stm32l5/src/bin/usb_serial.rs
+++ b/examples/stm32l5/src/bin/usb_serial.rs
@@ -3,7 +3,7 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::{panic, *}; 5use defmt::{panic, *};
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy_stm32::rcc::*; 7use embassy_stm32::rcc::*;
8use embassy_stm32::time::Hertz; 8use embassy_stm32::time::Hertz;
9use embassy_stm32::usb::{Driver, Instance}; 9use embassy_stm32::usb::{Driver, Instance};
@@ -24,7 +24,7 @@ fn config() -> Config {
24 config 24 config
25} 25}
26 26
27#[embassy::main(config = "config()")] 27#[embassy_executor::main(config = "config()")]
28async fn main(_spawner: Spawner, p: Peripherals) { 28async fn main(_spawner: Spawner, p: Peripherals) {
29 info!("Hello World!"); 29 info!("Hello World!");
30 30
diff --git a/examples/stm32u5/Cargo.toml b/examples/stm32u5/Cargo.toml
index 22e2e09a1..4ce95be4c 100644
--- a/examples/stm32u5/Cargo.toml
+++ b/examples/stm32u5/Cargo.toml
@@ -4,7 +4,8 @@ name = "embassy-stm32u5-examples"
4version = "0.1.0" 4version = "0.1.0"
5 5
6[dependencies] 6[dependencies]
7embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt", "defmt-timestamp-uptime", "time-tick-32768hz"] } 7embassy-util = { version = "0.1.0", path = "../../embassy-util", features = ["defmt"] }
8embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "defmt-timestamp-uptime", "time-tick-32768hz"] }
8embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "unstable-pac", "stm32u585ai", "time-driver-any", "memory-x" ] } 9embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "unstable-pac", "stm32u585ai", "time-driver-any", "memory-x" ] }
9 10
10defmt = "0.3" 11defmt = "0.3"
diff --git a/examples/stm32u5/src/bin/blinky.rs b/examples/stm32u5/src/bin/blinky.rs
index 4910e0b98..4f3eabc5e 100644
--- a/examples/stm32u5/src/bin/blinky.rs
+++ b/examples/stm32u5/src/bin/blinky.rs
@@ -3,13 +3,13 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::*; 5use defmt::*;
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy::time::{Duration, Timer}; 7use embassy_executor::time::{Duration, Timer};
8use embassy_stm32::gpio::{Level, Output, Speed}; 8use embassy_stm32::gpio::{Level, Output, Speed};
9use embassy_stm32::Peripherals; 9use embassy_stm32::Peripherals;
10use {defmt_rtt as _, panic_probe as _}; 10use {defmt_rtt as _, panic_probe as _};
11 11
12#[embassy::main] 12#[embassy_executor::main]
13async fn main(_spawner: Spawner, p: Peripherals) -> ! { 13async fn main(_spawner: Spawner, p: Peripherals) -> ! {
14 info!("Hello World!"); 14 info!("Hello World!");
15 15
diff --git a/examples/stm32wb/Cargo.toml b/examples/stm32wb/Cargo.toml
index 812d638fa..dc9107dd0 100644
--- a/examples/stm32wb/Cargo.toml
+++ b/examples/stm32wb/Cargo.toml
@@ -4,7 +4,8 @@ name = "embassy-stm32wb-examples"
4version = "0.1.0" 4version = "0.1.0"
5 5
6[dependencies] 6[dependencies]
7embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt", "defmt-timestamp-uptime", "time-tick-32768hz"] } 7embassy-util = { version = "0.1.0", path = "../../embassy-util", features = ["defmt"] }
8embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "defmt-timestamp-uptime", "time-tick-32768hz"] }
8embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32wb55cc", "time-driver-any", "exti"] } 9embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32wb55cc", "time-driver-any", "exti"] }
9 10
10defmt = "0.3" 11defmt = "0.3"
diff --git a/examples/stm32wb/src/bin/blinky.rs b/examples/stm32wb/src/bin/blinky.rs
index 8ab9b749d..3d8e8391d 100644
--- a/examples/stm32wb/src/bin/blinky.rs
+++ b/examples/stm32wb/src/bin/blinky.rs
@@ -3,13 +3,13 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::*; 5use defmt::*;
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy::time::{Duration, Timer}; 7use embassy_executor::time::{Duration, Timer};
8use embassy_stm32::gpio::{Level, Output, Speed}; 8use embassy_stm32::gpio::{Level, Output, Speed};
9use embassy_stm32::Peripherals; 9use embassy_stm32::Peripherals;
10use {defmt_rtt as _, panic_probe as _}; 10use {defmt_rtt as _, panic_probe as _};
11 11
12#[embassy::main] 12#[embassy_executor::main]
13async fn main(_spawner: Spawner, p: Peripherals) { 13async fn main(_spawner: Spawner, p: Peripherals) {
14 info!("Hello World!"); 14 info!("Hello World!");
15 15
diff --git a/examples/stm32wb/src/bin/button_exti.rs b/examples/stm32wb/src/bin/button_exti.rs
index 2ddeb887c..41afaf4d6 100644
--- a/examples/stm32wb/src/bin/button_exti.rs
+++ b/examples/stm32wb/src/bin/button_exti.rs
@@ -3,13 +3,13 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::*; 5use defmt::*;
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy_stm32::exti::ExtiInput; 7use embassy_stm32::exti::ExtiInput;
8use embassy_stm32::gpio::{Input, Pull}; 8use embassy_stm32::gpio::{Input, Pull};
9use embassy_stm32::Peripherals; 9use embassy_stm32::Peripherals;
10use {defmt_rtt as _, panic_probe as _}; 10use {defmt_rtt as _, panic_probe as _};
11 11
12#[embassy::main] 12#[embassy_executor::main]
13async fn main(_spawner: Spawner, p: Peripherals) { 13async fn main(_spawner: Spawner, p: Peripherals) {
14 info!("Hello World!"); 14 info!("Hello World!");
15 15
diff --git a/examples/stm32wl/Cargo.toml b/examples/stm32wl/Cargo.toml
index 6be360735..00d63f02d 100644
--- a/examples/stm32wl/Cargo.toml
+++ b/examples/stm32wl/Cargo.toml
@@ -4,7 +4,8 @@ name = "embassy-stm32wl-examples"
4version = "0.1.0" 4version = "0.1.0"
5 5
6[dependencies] 6[dependencies]
7embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt", "defmt-timestamp-uptime", "time-tick-32768hz"] } 7embassy-util = { version = "0.1.0", path = "../../embassy-util", features = ["defmt"] }
8embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "defmt-timestamp-uptime", "time-tick-32768hz"] }
8embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32wl55jc-cm4", "time-driver-any", "memory-x", "subghz", "unstable-pac", "exti"] } 9embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32wl55jc-cm4", "time-driver-any", "memory-x", "subghz", "unstable-pac", "exti"] }
9embassy-lora = { version = "0.1.0", path = "../../embassy-lora", features = ["stm32wl", "time", "defmt"] } 10embassy-lora = { version = "0.1.0", path = "../../embassy-lora", features = ["stm32wl", "time", "defmt"] }
10 11
diff --git a/examples/stm32wl/src/bin/blinky.rs b/examples/stm32wl/src/bin/blinky.rs
index 9393af1c6..e764b4cc3 100644
--- a/examples/stm32wl/src/bin/blinky.rs
+++ b/examples/stm32wl/src/bin/blinky.rs
@@ -3,13 +3,13 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::*; 5use defmt::*;
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy::time::{Duration, Timer}; 7use embassy_executor::time::{Duration, Timer};
8use embassy_stm32::gpio::{Level, Output, Speed}; 8use embassy_stm32::gpio::{Level, Output, Speed};
9use embassy_stm32::Peripherals; 9use embassy_stm32::Peripherals;
10use {defmt_rtt as _, panic_probe as _}; 10use {defmt_rtt as _, panic_probe as _};
11 11
12#[embassy::main] 12#[embassy_executor::main]
13async fn main(_spawner: Spawner, p: Peripherals) { 13async fn main(_spawner: Spawner, p: Peripherals) {
14 info!("Hello World!"); 14 info!("Hello World!");
15 15
diff --git a/examples/stm32wl/src/bin/button_exti.rs b/examples/stm32wl/src/bin/button_exti.rs
index 7d5c1b3cb..9f143597d 100644
--- a/examples/stm32wl/src/bin/button_exti.rs
+++ b/examples/stm32wl/src/bin/button_exti.rs
@@ -3,13 +3,13 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::*; 5use defmt::*;
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy_stm32::exti::ExtiInput; 7use embassy_stm32::exti::ExtiInput;
8use embassy_stm32::gpio::{Input, Pull}; 8use embassy_stm32::gpio::{Input, Pull};
9use embassy_stm32::Peripherals; 9use embassy_stm32::Peripherals;
10use {defmt_rtt as _, panic_probe as _}; 10use {defmt_rtt as _, panic_probe as _};
11 11
12#[embassy::main] 12#[embassy_executor::main]
13async fn main(_spawner: Spawner, p: Peripherals) { 13async fn main(_spawner: Spawner, p: Peripherals) {
14 info!("Hello World!"); 14 info!("Hello World!");
15 15
diff --git a/examples/stm32wl/src/bin/flash.rs b/examples/stm32wl/src/bin/flash.rs
index 6531feae9..46183b8a2 100644
--- a/examples/stm32wl/src/bin/flash.rs
+++ b/examples/stm32wl/src/bin/flash.rs
@@ -3,13 +3,13 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::{info, unwrap}; 5use defmt::{info, unwrap};
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy_stm32::flash::Flash; 7use embassy_stm32::flash::Flash;
8use embassy_stm32::Peripherals; 8use embassy_stm32::Peripherals;
9use embedded_storage::nor_flash::{NorFlash, ReadNorFlash}; 9use embedded_storage::nor_flash::{NorFlash, ReadNorFlash};
10use {defmt_rtt as _, panic_probe as _}; 10use {defmt_rtt as _, panic_probe as _};
11 11
12#[embassy::main] 12#[embassy_executor::main]
13async fn main(_spawner: Spawner, p: Peripherals) { 13async fn main(_spawner: Spawner, p: Peripherals) {
14 info!("Hello Flash!"); 14 info!("Hello Flash!");
15 15
diff --git a/examples/stm32wl/src/bin/lorawan.rs b/examples/stm32wl/src/bin/lorawan.rs
index 158c17e18..2db022ea2 100644
--- a/examples/stm32wl/src/bin/lorawan.rs
+++ b/examples/stm32wl/src/bin/lorawan.rs
@@ -23,8 +23,8 @@ fn config() -> embassy_stm32::Config {
23 config 23 config
24} 24}
25 25
26#[embassy::main(config = "config()")] 26#[embassy_executor::main(config = "config()")]
27async fn main(_spawner: embassy::executor::Spawner, p: Peripherals) { 27async fn main(_spawner: embassy_executor::executor::Spawner, p: Peripherals) {
28 unsafe { pac::RCC.ccipr().modify(|w| w.set_rngsel(0b01)) } 28 unsafe { pac::RCC.ccipr().modify(|w| w.set_rngsel(0b01)) }
29 29
30 let ctrl1 = Output::new(p.PC3.degrade(), Level::High, Speed::High); 30 let ctrl1 = Output::new(p.PC3.degrade(), Level::High, Speed::High);
diff --git a/examples/stm32wl/src/bin/subghz.rs b/examples/stm32wl/src/bin/subghz.rs
index c5f6e502a..775dfbbfc 100644
--- a/examples/stm32wl/src/bin/subghz.rs
+++ b/examples/stm32wl/src/bin/subghz.rs
@@ -6,13 +6,13 @@
6#![feature(type_alias_impl_trait)] 6#![feature(type_alias_impl_trait)]
7 7
8use defmt::*; 8use defmt::*;
9use embassy::channel::signal::Signal;
10use embassy_stm32::dma::NoDma; 9use embassy_stm32::dma::NoDma;
11use embassy_stm32::exti::ExtiInput; 10use embassy_stm32::exti::ExtiInput;
12use embassy_stm32::gpio::{Input, Level, Output, Pull, Speed}; 11use embassy_stm32::gpio::{Input, Level, Output, Pull, Speed};
13use embassy_stm32::interrupt::{Interrupt, InterruptExt}; 12use embassy_stm32::interrupt::{Interrupt, InterruptExt};
14use embassy_stm32::subghz::*; 13use embassy_stm32::subghz::*;
15use embassy_stm32::{interrupt, Peripherals}; 14use embassy_stm32::{interrupt, Peripherals};
15use embassy_util::channel::signal::Signal;
16use {defmt_rtt as _, panic_probe as _}; 16use {defmt_rtt as _, panic_probe as _};
17 17
18const PING_DATA: &str = "PING"; 18const PING_DATA: &str = "PING";
@@ -57,8 +57,8 @@ fn config() -> embassy_stm32::Config {
57 config 57 config
58} 58}
59 59
60#[embassy::main(config = "config()")] 60#[embassy_executor::main(config = "config()")]
61async fn main(_spawner: embassy::executor::Spawner, p: Peripherals) { 61async fn main(_spawner: embassy_executor::executor::Spawner, p: Peripherals) {
62 let mut led1 = Output::new(p.PB15, Level::High, Speed::Low); 62 let mut led1 = Output::new(p.PB15, Level::High, Speed::Low);
63 let mut led2 = Output::new(p.PB9, Level::Low, Speed::Low); 63 let mut led2 = Output::new(p.PB9, Level::Low, Speed::Low);
64 let mut led3 = Output::new(p.PB11, Level::Low, Speed::Low); 64 let mut led3 = Output::new(p.PB11, Level::Low, Speed::Low);
diff --git a/examples/wasm/Cargo.toml b/examples/wasm/Cargo.toml
index 347252fa3..4e26f023c 100644
--- a/examples/wasm/Cargo.toml
+++ b/examples/wasm/Cargo.toml
@@ -7,7 +7,8 @@ version = "0.1.0"
7crate-type = ["cdylib"] 7crate-type = ["cdylib"]
8 8
9[dependencies] 9[dependencies]
10embassy = { version = "0.1.0", path = "../../embassy", features = ["log", "wasm", "nightly"] } 10embassy-util = { version = "0.1.0", path = "../../embassy-util", features = ["log"] }
11embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["log", "wasm", "nightly"] }
11 12
12wasm-logger = "0.2.0" 13wasm-logger = "0.2.0"
13wasm-bindgen = "0.2" 14wasm-bindgen = "0.2"
diff --git a/examples/wasm/src/lib.rs b/examples/wasm/src/lib.rs
index 61757ebd7..2e961e65a 100644
--- a/examples/wasm/src/lib.rs
+++ b/examples/wasm/src/lib.rs
@@ -1,10 +1,10 @@
1#![feature(type_alias_impl_trait)] 1#![feature(type_alias_impl_trait)]
2#![allow(incomplete_features)] 2#![allow(incomplete_features)]
3 3
4use embassy::executor::Spawner; 4use embassy_executor::executor::Spawner;
5use embassy::time::{Duration, Timer}; 5use embassy_executor::time::{Duration, Timer};
6 6
7#[embassy::task] 7#[embassy_executor::task]
8async fn ticker() { 8async fn ticker() {
9 let window = web_sys::window().expect("no global `window` exists"); 9 let window = web_sys::window().expect("no global `window` exists");
10 10
@@ -24,7 +24,7 @@ async fn ticker() {
24 } 24 }
25} 25}
26 26
27#[embassy::main] 27#[embassy_executor::main]
28async fn main(spawner: Spawner) { 28async fn main(spawner: Spawner) {
29 wasm_logger::init(wasm_logger::Config::default()); 29 wasm_logger::init(wasm_logger::Config::default());
30 spawner.spawn(ticker()).unwrap(); 30 spawner.spawn(ticker()).unwrap();