aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/rust.yml2
-rw-r--r--.vscode/settings.json5
-rw-r--r--README.md12
-rwxr-xr-xci.sh50
-rwxr-xr-xci_stable.sh74
-rw-r--r--docs/modules/ROOT/examples/basic/Cargo.toml2
-rw-r--r--docs/modules/ROOT/examples/basic/src/main.rs8
-rw-r--r--docs/modules/ROOT/examples/layer-by-layer/Cargo.toml2
-rw-r--r--docs/modules/ROOT/examples/layer-by-layer/blinky-async/Cargo.toml2
-rw-r--r--docs/modules/ROOT/examples/layer-by-layer/blinky-async/src/main.rs4
-rw-r--r--embassy-boot/boot/Cargo.toml2
-rw-r--r--embassy-boot/nrf/Cargo.toml2
-rw-r--r--embassy-boot/stm32/Cargo.toml2
-rw-r--r--embassy-cortex-m/Cargo.toml3
-rw-r--r--embassy-cortex-m/src/executor.rs8
-rw-r--r--embassy-embedded-hal/Cargo.toml2
-rw-r--r--embassy-embedded-hal/src/shared_bus/asynch/i2c.rs8
-rw-r--r--embassy-embedded-hal/src/shared_bus/asynch/spi.rs8
-rw-r--r--embassy-embedded-hal/src/shared_bus/blocking/i2c.rs6
-rw-r--r--embassy-embedded-hal/src/shared_bus/blocking/spi.rs6
-rw-r--r--embassy-executor/Cargo.toml (renamed from embassy/Cargo.toml)43
-rw-r--r--embassy-executor/build.rs (renamed from embassy/build.rs)0
-rw-r--r--embassy-executor/src/executor/arch/cortex_m.rs (renamed from embassy/src/executor/arch/cortex_m.rs)9
-rw-r--r--embassy-executor/src/executor/arch/riscv32.rs (renamed from embassy/src/executor/arch/riscv32.rs)0
-rw-r--r--embassy-executor/src/executor/arch/std.rs (renamed from embassy/src/executor/arch/std.rs)0
-rw-r--r--embassy-executor/src/executor/arch/wasm.rs (renamed from embassy/src/executor/arch/wasm.rs)0
-rw-r--r--embassy-executor/src/executor/arch/xtensa.rs (renamed from embassy/src/executor/arch/xtensa.rs)0
-rw-r--r--embassy-executor/src/executor/mod.rs (renamed from embassy/src/executor/mod.rs)2
-rw-r--r--embassy-executor/src/executor/raw/mod.rs (renamed from embassy/src/executor/raw/mod.rs)4
-rw-r--r--embassy-executor/src/executor/raw/run_queue.rs (renamed from embassy/src/executor/raw/run_queue.rs)0
-rw-r--r--embassy-executor/src/executor/raw/timer_queue.rs (renamed from embassy/src/executor/raw/timer_queue.rs)0
-rw-r--r--embassy-executor/src/executor/raw/util.rs (renamed from embassy/src/executor/raw/util.rs)0
-rw-r--r--embassy-executor/src/executor/raw/waker.rs (renamed from embassy/src/executor/raw/waker.rs)2
-rw-r--r--embassy-executor/src/executor/spawner.rs (renamed from embassy/src/executor/spawner.rs)12
-rw-r--r--embassy-executor/src/fmt.rs (renamed from embassy/src/fmt.rs)0
-rw-r--r--embassy-executor/src/lib.rs (renamed from embassy/src/lib.rs)5
-rw-r--r--embassy-executor/src/time/delay.rs (renamed from embassy/src/time/delay.rs)2
-rw-r--r--embassy-executor/src/time/driver.rs (renamed from embassy/src/time/driver.rs)10
-rw-r--r--embassy-executor/src/time/driver_std.rs (renamed from embassy/src/time/driver_std.rs)0
-rw-r--r--embassy-executor/src/time/driver_wasm.rs (renamed from embassy/src/time/driver_wasm.rs)0
-rw-r--r--embassy-executor/src/time/duration.rs (renamed from embassy/src/time/duration.rs)0
-rw-r--r--embassy-executor/src/time/instant.rs (renamed from embassy/src/time/instant.rs)0
-rw-r--r--embassy-executor/src/time/mod.rs (renamed from embassy/src/time/mod.rs)4
-rw-r--r--embassy-executor/src/time/timer.rs (renamed from embassy/src/time/timer.rs)16
-rw-r--r--embassy-hal-common/Cargo.toml5
-rw-r--r--embassy-hal-common/src/lib.rs10
-rw-r--r--embassy-lora/Cargo.toml7
-rw-r--r--embassy-lora/src/lib.rs2
-rw-r--r--embassy-lora/src/stm32wl/mod.rs2
-rw-r--r--embassy-lora/src/sx127x/sx127x_lora/mod.rs2
-rw-r--r--embassy-macros/src/macros/cortex_m_interrupt_take.rs8
-rw-r--r--embassy-macros/src/macros/main.rs4
-rw-r--r--embassy-macros/src/macros/task.rs2
-rw-r--r--embassy-net/Cargo.toml5
-rw-r--r--embassy-net/src/stack.rs4
-rw-r--r--embassy-nrf/Cargo.toml11
-rw-r--r--embassy-nrf/src/buffered_uarte.rs14
-rw-r--r--embassy-nrf/src/gpiote.rs2
-rw-r--r--embassy-nrf/src/qdec.rs2
-rw-r--r--embassy-nrf/src/qspi.rs2
-rw-r--r--embassy-nrf/src/rng.rs2
-rw-r--r--embassy-nrf/src/saadc.rs2
-rw-r--r--embassy-nrf/src/spim.rs2
-rw-r--r--embassy-nrf/src/temp.rs2
-rw-r--r--embassy-nrf/src/time_driver.rs8
-rw-r--r--embassy-nrf/src/timer.rs6
-rw-r--r--embassy-nrf/src/twim.rs6
-rw-r--r--embassy-nrf/src/uarte.rs2
-rw-r--r--embassy-nrf/src/usb.rs2
-rw-r--r--embassy-rp/Cargo.toml5
-rw-r--r--embassy-rp/src/gpio.rs2
-rw-r--r--embassy-rp/src/timer.rs8
-rw-r--r--embassy-stm32/Cargo.toml11
-rw-r--r--embassy-stm32/src/dcmi.rs2
-rw-r--r--embassy-stm32/src/dma/bdma.rs2
-rw-r--r--embassy-stm32/src/dma/dma.rs2
-rw-r--r--embassy-stm32/src/dma/gpdma.rs2
-rw-r--r--embassy-stm32/src/eth/v1/mod.rs2
-rw-r--r--embassy-stm32/src/eth/v2/mod.rs2
-rw-r--r--embassy-stm32/src/exti.rs2
-rw-r--r--embassy-stm32/src/i2c/v2.rs2
-rw-r--r--embassy-stm32/src/rng.rs2
-rw-r--r--embassy-stm32/src/sdmmc/mod.rs6
-rw-r--r--embassy-stm32/src/subghz/mod.rs2
-rw-r--r--embassy-stm32/src/subghz/timeout.rs4
-rw-r--r--embassy-stm32/src/subghz/tx_params.rs18
-rw-r--r--embassy-stm32/src/time_driver.rs10
-rw-r--r--embassy-stm32/src/usart/buffered.rs2
-rw-r--r--embassy-stm32/src/usb/usb.rs4
-rw-r--r--embassy-usb-hid/Cargo.toml4
-rw-r--r--embassy-usb-hid/src/lib.rs23
-rw-r--r--embassy-usb-ncm/Cargo.toml2
-rw-r--r--embassy-usb-serial/Cargo.toml2
-rw-r--r--embassy-usb-serial/src/lib.rs2
-rw-r--r--embassy-usb/Cargo.toml2
-rw-r--r--embassy-usb/src/lib.rs2
-rw-r--r--embassy-util/Cargo.toml28
-rw-r--r--embassy-util/build.rs29
-rw-r--r--embassy-util/src/blocking_mutex/mod.rs (renamed from embassy/src/blocking_mutex/mod.rs)11
-rw-r--r--embassy-util/src/blocking_mutex/raw.rs (renamed from embassy/src/blocking_mutex/raw.rs)3
-rw-r--r--embassy-util/src/channel/mod.rs (renamed from embassy/src/channel/mod.rs)0
-rw-r--r--embassy-util/src/channel/mpmc.rs (renamed from embassy/src/channel/mpmc.rs)27
-rw-r--r--embassy-util/src/channel/pubsub/mod.rs (renamed from embassy/src/channel/pubsub/mod.rs)6
-rw-r--r--embassy-util/src/channel/pubsub/publisher.rs (renamed from embassy/src/channel/pubsub/publisher.rs)3
-rw-r--r--embassy-util/src/channel/pubsub/subscriber.rs (renamed from embassy/src/channel/pubsub/subscriber.rs)5
-rw-r--r--embassy-util/src/channel/signal.rs (renamed from embassy/src/channel/signal.rs)4
-rw-r--r--embassy-util/src/fmt.rs228
-rw-r--r--embassy-util/src/forever.rs (renamed from embassy/src/util/forever.rs)2
-rw-r--r--embassy-util/src/lib.rs22
-rw-r--r--embassy-util/src/mutex.rs (renamed from embassy/src/mutex.rs)15
-rw-r--r--embassy-util/src/select.rs (renamed from embassy/src/util/select.rs)0
-rw-r--r--embassy-util/src/waitqueue/mod.rs (renamed from embassy/src/waitqueue/mod.rs)1
-rw-r--r--embassy-util/src/waitqueue/multi_waker.rs (renamed from embassy/src/waitqueue/multi_waker.rs)0
-rw-r--r--embassy-util/src/waitqueue/waker.rs (renamed from embassy/src/waitqueue/waker_agnostic.rs)0
-rw-r--r--embassy-util/src/yield_now.rs (renamed from embassy/src/util/yield_now.rs)0
-rw-r--r--embassy/src/util/mod.rs9
-rw-r--r--embassy/src/waitqueue/waker.rs97
-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
-rw-r--r--tests/rp/Cargo.toml3
-rw-r--r--tests/rp/src/bin/gpio.rs4
-rw-r--r--tests/rp/src/bin/gpio_async.rs6
-rw-r--r--tests/stm32/Cargo.toml3
-rw-r--r--tests/stm32/src/bin/gpio.rs4
-rw-r--r--tests/stm32/src/bin/spi.rs4
-rw-r--r--tests/stm32/src/bin/spi_dma.rs4
-rw-r--r--tests/stm32/src/bin/timer.rs6
-rw-r--r--tests/stm32/src/bin/usart.rs4
-rw-r--r--tests/stm32/src/bin/usart_dma.rs4
319 files changed, 1159 insertions, 998 deletions
diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml
index 6115e618d..d76e5ced4 100644
--- a/.github/workflows/rust.yml
+++ b/.github/workflows/rust.yml
@@ -69,4 +69,4 @@ jobs:
69 steps: 69 steps:
70 - uses: actions/checkout@v2 70 - uses: actions/checkout@v2
71 - name: Test 71 - name: Test
72 run: cd embassy && cargo test 72 run: cd embassy-util && cargo test
diff --git a/.vscode/settings.json b/.vscode/settings.json
index 5ce8e4e7d..1ac3fc513 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -12,10 +12,15 @@
12 //"embassy-net/medium-ethernet", 12 //"embassy-net/medium-ethernet",
13 //"embassy-net/tcp", 13 //"embassy-net/tcp",
14 //"embassy-net/pool-16", 14 //"embassy-net/pool-16",
15 //"time-tick-16mhz",
16 //"defmt-timestamp-uptime",
15 "nightly", 17 "nightly",
18 //"unstable-traits",
16 ], 19 ],
17 "rust-analyzer.linkedProjects": [ 20 "rust-analyzer.linkedProjects": [
18 // Declare for the target you wish to develop 21 // Declare for the target you wish to develop
22 //"embassy-executor/Cargo.toml",
23 //"embassy-util/Cargo.toml",
19 "examples/nrf/Cargo.toml", 24 "examples/nrf/Cargo.toml",
20 // "examples/rp/Cargo.toml", 25 // "examples/rp/Cargo.toml",
21 // "examples/std/Cargo.toml", 26 // "examples/std/Cargo.toml",
diff --git a/README.md b/README.md
index a7a7ccd54..423740674 100644
--- a/README.md
+++ b/README.md
@@ -16,7 +16,7 @@ Rust's <a href="https://rust-lang.github.io/async-book/">async/await</a> allows
16 - <a href="https://docs.embassy.dev/embassy-nrf/">embassy-nrf</a>, for the Nordic Semiconductor nRF52, nRF53, nRF91 series. 16 - <a href="https://docs.embassy.dev/embassy-nrf/">embassy-nrf</a>, for the Nordic Semiconductor nRF52, nRF53, nRF91 series.
17 17
18- **Time that Just Works** - 18- **Time that Just Works** -
19No more messing with hardware timers. <a href="https://docs.embassy.dev/embassy/git/thumbv7em-none-eabihf/time/index.html">embassy::time</a> provides Instant, Duration and Timer types that are globally available and never overflow. 19No more messing with hardware timers. <a href="https://docs.embassy.dev/embassy/git/thumbv7em-none-eabihf/time/index.html">embassy_executor::time</a> provides Instant, Duration and Timer types that are globally available and never overflow.
20 20
21- **Real-time ready** - 21- **Real-time ready** -
22Tasks on the same async executor run cooperatively, but you can create multiple executors with different priorities, so that higher priority tasks preempt lower priority ones. See the <a href="https://github.com/embassy-rs/embassy/blob/master/examples/nrf/src/bin/multiprio.rs">example</a>. 22Tasks on the same async executor run cooperatively, but you can create multiple executors with different priorities, so that higher priority tasks preempt lower priority ones. See the <a href="https://github.com/embassy-rs/embassy/blob/master/examples/nrf/src/bin/multiprio.rs">example</a>.
@@ -44,13 +44,13 @@ The <a href="https://github.com/embassy-rs/nrf-softdevice">nrf-softdevice</a> cr
44 44
45```rust,ignore 45```rust,ignore
46use defmt::info; 46use defmt::info;
47use embassy::executor::Spawner; 47use embassy_executor::executor::Spawner;
48use embassy::time::{Duration, Timer}; 48use embassy_executor::time::{Duration, Timer};
49use embassy_nrf::gpio::{AnyPin, Input, Level, Output, OutputDrive, Pin, Pull}; 49use embassy_nrf::gpio::{AnyPin, Input, Level, Output, OutputDrive, Pin, Pull};
50use embassy_nrf::Peripherals; 50use embassy_nrf::Peripherals;
51 51
52// Declare async tasks 52// Declare async tasks
53#[embassy::task] 53#[embassy_executor::task]
54async fn blink(pin: AnyPin) { 54async fn blink(pin: AnyPin) {
55 let mut led = Output::new(pin, Level::Low, OutputDrive::Standard); 55 let mut led = Output::new(pin, Level::Low, OutputDrive::Standard);
56 56
@@ -64,7 +64,7 @@ async fn blink(pin: AnyPin) {
64} 64}
65 65
66// Main is itself an async task as well. 66// Main is itself an async task as well.
67#[embassy::main] 67#[embassy_executor::main]
68async fn main(spawner: Spawner, p: Peripherals) { 68async fn main(spawner: Spawner, p: Peripherals) {
69 // Spawned tasks run in the background, concurrently. 69 // Spawned tasks run in the background, concurrently.
70 spawner.spawn(blink(p.P0_13.degrade())).unwrap(); 70 spawner.spawn(blink(p.P0_13.degrade())).unwrap();
@@ -132,7 +132,7 @@ Embassy is guaranteed to compile on the latest stable Rust version at the time o
132 132
133Several features require nightly: 133Several features require nightly:
134 134
135- The `#[embassy::main]` and `#[embassy::task]` attribute macros. 135- The `#[embassy_executor::main]` and `#[embassy_executor::task]` attribute macros.
136- Async traits 136- Async traits
137 137
138These are enabled by activating the `nightly` Cargo feature. If you do so, Embassy is guaranteed to compile on the exact nightly version specified in `rust-toolchain.toml`. It might compile with older or newer nightly versions, but that may change in any new patch release. 138These are enabled by activating the `nightly` Cargo feature. If you do so, Embassy is guaranteed to compile on the exact nightly version specified in `rust-toolchain.toml`. It might compile with older or newer nightly versions, but that may change in any new patch release.
diff --git a/ci.sh b/ci.sh
index e34f1dfe3..6ec2410f7 100755
--- a/ci.sh
+++ b/ci.sh
@@ -32,10 +32,10 @@ rm -rf stm32-metapac
32mv stm32-metapac-gen/out stm32-metapac 32mv stm32-metapac-gen/out stm32-metapac
33 33
34cargo batch \ 34cargo batch \
35 --- build --release --manifest-path embassy/Cargo.toml --target thumbv7em-none-eabi --features nightly \ 35 --- build --release --manifest-path embassy-executor/Cargo.toml --target thumbv7em-none-eabi --features nightly \
36 --- build --release --manifest-path embassy/Cargo.toml --target thumbv7em-none-eabi --features nightly,log,executor-agnostic \ 36 --- build --release --manifest-path embassy-executor/Cargo.toml --target thumbv7em-none-eabi --features nightly,log \
37 --- build --release --manifest-path embassy/Cargo.toml --target thumbv7em-none-eabi --features nightly,defmt \ 37 --- build --release --manifest-path embassy-executor/Cargo.toml --target thumbv7em-none-eabi --features nightly,defmt \
38 --- build --release --manifest-path embassy/Cargo.toml --target thumbv6m-none-eabi --features nightly,defmt \ 38 --- build --release --manifest-path embassy-executor/Cargo.toml --target thumbv6m-none-eabi --features nightly,defmt \
39 --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nightly,nrf52805,gpiote,time-driver-rtc1 \ 39 --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nightly,nrf52805,gpiote,time-driver-rtc1 \
40 --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nightly,nrf52810,gpiote,time-driver-rtc1 \ 40 --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nightly,nrf52810,gpiote,time-driver-rtc1 \
41 --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nightly,nrf52811,gpiote,time-driver-rtc1 \ 41 --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nightly,nrf52811,gpiote,time-driver-rtc1 \
@@ -54,27 +54,27 @@ cargo batch \
54 --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi --features nightly,unstable-traits,log \ 54 --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi --features nightly,unstable-traits,log \
55 --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi --features nightly,unstable-traits \ 55 --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi --features nightly,unstable-traits \
56 --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi --features nightly \ 56 --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi --features nightly \
57 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features nightly,stm32f410tb,defmt,exti,time-driver-any,embassy/time-tick-32768hz,unstable-traits \ 57 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features nightly,stm32f410tb,defmt,exti,time-driver-any,embassy-executor/time-tick-32768hz,unstable-traits \
58 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features nightly,stm32f411ce,defmt,exti,time-driver-any,embassy/time-tick-32768hz,unstable-traits \ 58 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features nightly,stm32f411ce,defmt,exti,time-driver-any,embassy-executor/time-tick-32768hz,unstable-traits \
59 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features nightly,stm32f429zi,log,exti,time-driver-any,embassy/time-tick-32768hz,unstable-traits \ 59 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features nightly,stm32f429zi,log,exti,time-driver-any,embassy-executor/time-tick-32768hz,unstable-traits \
60 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features nightly,stm32h755zi-cm7,defmt,exti,time-driver-any,embassy/time-tick-32768hz,unstable-traits \ 60 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features nightly,stm32h755zi-cm7,defmt,exti,time-driver-any,embassy-executor/time-tick-32768hz,unstable-traits \
61 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features nightly,stm32h7b3ai,defmt,exti,time-driver-any,embassy/time-tick-32768hz,unstable-traits \ 61 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features nightly,stm32h7b3ai,defmt,exti,time-driver-any,embassy-executor/time-tick-32768hz,unstable-traits \
62 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features nightly,stm32l476vg,defmt,exti,time-driver-any,embassy/time-tick-32768hz,unstable-traits \ 62 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features nightly,stm32l476vg,defmt,exti,time-driver-any,embassy-executor/time-tick-32768hz,unstable-traits \
63 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features nightly,stm32wb15cc,defmt,exti,time-driver-any,embassy/time-tick-32768hz,unstable-traits \ 63 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features nightly,stm32wb15cc,defmt,exti,time-driver-any,embassy-executor/time-tick-32768hz,unstable-traits \
64 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features nightly,stm32l072cz,defmt,exti,time-driver-any,embassy/time-tick-32768hz,unstable-traits \ 64 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features nightly,stm32l072cz,defmt,exti,time-driver-any,embassy-executor/time-tick-32768hz,unstable-traits \
65 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features nightly,stm32l041f6,defmt,exti,time-driver-any,embassy/time-tick-32768hz,unstable-traits \ 65 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features nightly,stm32l041f6,defmt,exti,time-driver-any,embassy-executor/time-tick-32768hz,unstable-traits \
66 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7m-none-eabi --features nightly,stm32l151cb-a,defmt,exti,time-driver-any,embassy/time-tick-32768hz,unstable-traits \ 66 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7m-none-eabi --features nightly,stm32l151cb-a,defmt,exti,time-driver-any,embassy-executor/time-tick-32768hz,unstable-traits \
67 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7m-none-eabi --features nightly,stm32f398ve,defmt,exti,time-driver-any,embassy/time-tick-32768hz,unstable-traits \ 67 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7m-none-eabi --features nightly,stm32f398ve,defmt,exti,time-driver-any,embassy-executor/time-tick-32768hz,unstable-traits \
68 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features nightly,stm32g0c1ve,defmt,exti,time-driver-any,embassy/time-tick-32768hz,unstable-traits \ 68 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features nightly,stm32g0c1ve,defmt,exti,time-driver-any,embassy-executor/time-tick-32768hz,unstable-traits \
69 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7m-none-eabi --features nightly,stm32f217zg,defmt,exti,time-driver-any,embassy/time-tick-32768hz,unstable-traits \ 69 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7m-none-eabi --features nightly,stm32f217zg,defmt,exti,time-driver-any,embassy-executor/time-tick-32768hz,unstable-traits \
70 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features nightly,stm32l552ze,defmt,exti,time-driver-any,embassy/time-tick-32768hz,unstable-traits \ 70 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features nightly,stm32l552ze,defmt,exti,time-driver-any,embassy-executor/time-tick-32768hz,unstable-traits \
71 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features nightly,stm32wl54jc-cm0p,defmt,exti,time-driver-any,embassy/time-tick-32768hz,unstable-traits \ 71 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features nightly,stm32wl54jc-cm0p,defmt,exti,time-driver-any,embassy-executor/time-tick-32768hz,unstable-traits \
72 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features nightly,stm32wle5ub,defmt,exti,time-driver-any,embassy/time-tick-32768hz,unstable-traits \ 72 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features nightly,stm32wle5ub,defmt,exti,time-driver-any,embassy-executor/time-tick-32768hz,unstable-traits \
73 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7m-none-eabi --features nightly,stm32f107vc,defmt,exti,time-driver-any,embassy/time-tick-32768hz,unstable-traits \ 73 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7m-none-eabi --features nightly,stm32f107vc,defmt,exti,time-driver-any,embassy-executor/time-tick-32768hz,unstable-traits \
74 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7m-none-eabi --features nightly,stm32f103re,defmt,exti,time-driver-any,embassy/time-tick-32768hz,unstable-traits \ 74 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7m-none-eabi --features nightly,stm32f103re,defmt,exti,time-driver-any,embassy-executor/time-tick-32768hz,unstable-traits \
75 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7m-none-eabi --features nightly,stm32f100c4,defmt,exti,time-driver-any,embassy/time-tick-32768hz,unstable-traits \ 75 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7m-none-eabi --features nightly,stm32f100c4,defmt,exti,time-driver-any,embassy-executor/time-tick-32768hz,unstable-traits \
76 --- build --release --manifest-path embassy-boot/nrf/Cargo.toml --target thumbv7em-none-eabi --features embassy-nrf/nrf52840 \ 76 --- build --release --manifest-path embassy-boot/nrf/Cargo.toml --target thumbv7em-none-eabi --features embassy-nrf/nrf52840 \
77 --- build --release --manifest-path embassy-boot/stm32/Cargo.toml --target thumbv7em-none-eabi --features embassy-stm32/stm32wl55jc-cm4,embassy/time-tick-32768hz \ 77 --- build --release --manifest-path embassy-boot/stm32/Cargo.toml --target thumbv7em-none-eabi --features embassy-stm32/stm32wl55jc-cm4 \
78 --- build --release --manifest-path docs/modules/ROOT/examples/basic/Cargo.toml --target thumbv7em-none-eabi \ 78 --- build --release --manifest-path docs/modules/ROOT/examples/basic/Cargo.toml --target thumbv7em-none-eabi \
79 --- build --release --manifest-path docs/modules/ROOT/examples/layer-by-layer/blinky-pac/Cargo.toml --target thumbv7em-none-eabi \ 79 --- build --release --manifest-path docs/modules/ROOT/examples/layer-by-layer/blinky-pac/Cargo.toml --target thumbv7em-none-eabi \
80 --- build --release --manifest-path docs/modules/ROOT/examples/layer-by-layer/blinky-hal/Cargo.toml --target thumbv7em-none-eabi \ 80 --- build --release --manifest-path docs/modules/ROOT/examples/layer-by-layer/blinky-hal/Cargo.toml --target thumbv7em-none-eabi \
@@ -106,7 +106,7 @@ cargo batch \
106 --- build --release --manifest-path examples/boot/application/stm32l4/Cargo.toml --target thumbv7em-none-eabi --out-dir out/examples/boot/stm32l4 --bin b \ 106 --- build --release --manifest-path examples/boot/application/stm32l4/Cargo.toml --target thumbv7em-none-eabi --out-dir out/examples/boot/stm32l4 --bin b \
107 --- build --release --manifest-path examples/boot/application/stm32wl/Cargo.toml --target thumbv7em-none-eabihf --out-dir out/examples/boot/stm32wl --bin b \ 107 --- build --release --manifest-path examples/boot/application/stm32wl/Cargo.toml --target thumbv7em-none-eabihf --out-dir out/examples/boot/stm32wl --bin b \
108 --- build --release --manifest-path examples/boot/bootloader/nrf/Cargo.toml --target thumbv7em-none-eabi --features embassy-nrf/nrf52840 \ 108 --- build --release --manifest-path examples/boot/bootloader/nrf/Cargo.toml --target thumbv7em-none-eabi --features embassy-nrf/nrf52840 \
109 --- build --release --manifest-path examples/boot/bootloader/stm32/Cargo.toml --target thumbv7em-none-eabi --features embassy-stm32/stm32wl55jc-cm4,embassy/time-tick-32768hz \ 109 --- build --release --manifest-path examples/boot/bootloader/stm32/Cargo.toml --target thumbv7em-none-eabi --features embassy-stm32/stm32wl55jc-cm4 \
110 --- build --release --manifest-path examples/wasm/Cargo.toml --target wasm32-unknown-unknown --out-dir out/examples/wasm \ 110 --- build --release --manifest-path examples/wasm/Cargo.toml --target wasm32-unknown-unknown --out-dir out/examples/wasm \
111 --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv7m-none-eabi --features stm32f103c8 --out-dir out/tests/bluepill-stm32f103c8 \ 111 --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv7m-none-eabi --features stm32f103c8 --out-dir out/tests/bluepill-stm32f103c8 \
112 --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f429zi --out-dir out/tests/nucleo-stm32f429zi \ 112 --- build --release --manifest-path tests/stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f429zi --out-dir out/tests/nucleo-stm32f429zi \
diff --git a/ci_stable.sh b/ci_stable.sh
index 2723936e7..7521827d8 100755
--- a/ci_stable.sh
+++ b/ci_stable.sh
@@ -9,10 +9,10 @@ export DEFMT_LOG=trace
9sed -i 's/channel.*/channel = "stable"/g' rust-toolchain.toml 9sed -i 's/channel.*/channel = "stable"/g' rust-toolchain.toml
10 10
11cargo batch \ 11cargo batch \
12 --- build --release --manifest-path embassy/Cargo.toml --target thumbv7em-none-eabi \ 12 --- build --release --manifest-path embassy-executor/Cargo.toml --target thumbv7em-none-eabi \
13 --- build --release --manifest-path embassy/Cargo.toml --target thumbv7em-none-eabi --features log,executor-agnostic \ 13 --- build --release --manifest-path embassy-executor/Cargo.toml --target thumbv7em-none-eabi --features log \
14 --- build --release --manifest-path embassy/Cargo.toml --target thumbv7em-none-eabi --features defmt \ 14 --- build --release --manifest-path embassy-executor/Cargo.toml --target thumbv7em-none-eabi --features defmt \
15 --- build --release --manifest-path embassy/Cargo.toml --target thumbv6m-none-eabi --features defmt \ 15 --- build --release --manifest-path embassy-executor/Cargo.toml --target thumbv6m-none-eabi --features defmt \
16 --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52805,gpiote,time-driver-rtc1 \ 16 --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52805,gpiote,time-driver-rtc1 \
17 --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52810,gpiote,time-driver-rtc1 \ 17 --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52810,gpiote,time-driver-rtc1 \
18 --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52811,gpiote,time-driver-rtc1 \ 18 --- build --release --manifest-path embassy-nrf/Cargo.toml --target thumbv7em-none-eabi --features nrf52811,gpiote,time-driver-rtc1 \
@@ -30,38 +30,38 @@ cargo batch \
30 --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi --features unstable-traits,defmt \ 30 --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi --features unstable-traits,defmt \
31 --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi --features unstable-traits,log \ 31 --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi --features unstable-traits,log \
32 --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi \ 32 --- build --release --manifest-path embassy-rp/Cargo.toml --target thumbv6m-none-eabi \
33 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32g473cc,defmt,exti,time-driver-any,embassy/time-tick-32768hz,unstable-traits \ 33 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32g473cc,defmt,exti,time-driver-any,embassy-executor/time-tick-32768hz,unstable-traits \
34 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32g491re,defmt,exti,time-driver-any,embassy/time-tick-32768hz,unstable-traits \ 34 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32g491re,defmt,exti,time-driver-any,embassy-executor/time-tick-32768hz,unstable-traits \
35 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32u585zi,defmt,exti,time-driver-any,embassy/time-tick-32768hz,unstable-traits \ 35 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32u585zi,defmt,exti,time-driver-any,embassy-executor/time-tick-32768hz,unstable-traits \
36 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32wb55vy,defmt,exti,time-driver-any,embassy/time-tick-32768hz,unstable-traits \ 36 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32wb55vy,defmt,exti,time-driver-any,embassy-executor/time-tick-32768hz,unstable-traits \
37 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32wl55uc-cm4,defmt,exti,time-driver-any,embassy/time-tick-32768hz,unstable-traits \ 37 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32wl55uc-cm4,defmt,exti,time-driver-any,embassy-executor/time-tick-32768hz,unstable-traits \
38 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32l4r9zi,defmt,exti,time-driver-any,embassy/time-tick-32768hz,unstable-traits \ 38 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32l4r9zi,defmt,exti,time-driver-any,embassy-executor/time-tick-32768hz,unstable-traits \
39 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f303vc,defmt,exti,time-driver-any,embassy/time-tick-32768hz,unstable-traits \ 39 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f303vc,defmt,exti,time-driver-any,embassy-executor/time-tick-32768hz,unstable-traits \
40 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f411ce,defmt,time-driver-any,embassy/time-tick-32768hz \ 40 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f411ce,defmt,time-driver-any,embassy-executor/time-tick-32768hz \
41 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f411ce,defmt,time-driver-any,embassy/time-tick-32768hz,unstable-traits \ 41 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f411ce,defmt,time-driver-any,embassy-executor/time-tick-32768hz,unstable-traits \
42 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f429zi,log,time-driver-any,embassy/time-tick-32768hz \ 42 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f429zi,log,time-driver-any,embassy-executor/time-tick-32768hz \
43 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f429zi,log,time-driver-any,embassy/time-tick-32768hz,unstable-traits \ 43 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f429zi,log,time-driver-any,embassy-executor/time-tick-32768hz,unstable-traits \
44 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32h755zi-cm7,defmt,time-driver-any,embassy/time-tick-32768hz \ 44 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32h755zi-cm7,defmt,time-driver-any,embassy-executor/time-tick-32768hz \
45 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32h755zi-cm7,defmt,time-driver-any,embassy/time-tick-32768hz,unstable-traits \ 45 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32h755zi-cm7,defmt,time-driver-any,embassy-executor/time-tick-32768hz,unstable-traits \
46 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32l476vg,defmt,time-driver-any,embassy/time-tick-32768hz \ 46 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32l476vg,defmt,time-driver-any,embassy-executor/time-tick-32768hz \
47 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32l476vg,defmt,time-driver-any,embassy/time-tick-32768hz,unstable-traits \ 47 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32l476vg,defmt,time-driver-any,embassy-executor/time-tick-32768hz,unstable-traits \
48 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32l072cz,defmt,time-driver-any,embassy/time-tick-32768hz \ 48 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32l072cz,defmt,time-driver-any,embassy-executor/time-tick-32768hz \
49 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32l072cz,defmt,time-driver-any,embassy/time-tick-32768hz,unstable-traits \ 49 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32l072cz,defmt,time-driver-any,embassy-executor/time-tick-32768hz,unstable-traits \
50 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7m-none-eabi --features stm32l151cb-a,defmt,time-driver-any,embassy/time-tick-32768hz \ 50 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7m-none-eabi --features stm32l151cb-a,defmt,time-driver-any,embassy-executor/time-tick-32768hz \
51 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7m-none-eabi --features stm32l151cb-a,defmt,time-driver-any,embassy/time-tick-32768hz,unstable-traits \ 51 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7m-none-eabi --features stm32l151cb-a,defmt,time-driver-any,embassy-executor/time-tick-32768hz,unstable-traits \
52 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f410tb,defmt,exti,time-driver-any,embassy/time-tick-32768hz \ 52 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f410tb,defmt,exti,time-driver-any,embassy-executor/time-tick-32768hz \
53 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f410tb,defmt,exti,time-driver-any,embassy/time-tick-32768hz,unstable-traits \ 53 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f410tb,defmt,exti,time-driver-any,embassy-executor/time-tick-32768hz,unstable-traits \
54 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f429zi,log,exti,time-driver-any,embassy/time-tick-32768hz \ 54 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f429zi,log,exti,time-driver-any,embassy-executor/time-tick-32768hz \
55 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f429zi,log,exti,time-driver-any,embassy/time-tick-32768hz,unstable-traits \ 55 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f429zi,log,exti,time-driver-any,embassy-executor/time-tick-32768hz,unstable-traits \
56 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32h755zi-cm7,defmt,exti,time-driver-any,embassy/time-tick-32768hz \ 56 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32h755zi-cm7,defmt,exti,time-driver-any,embassy-executor/time-tick-32768hz \
57 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32h755zi-cm7,defmt,exti,time-driver-any,embassy/time-tick-32768hz,unstable-traits \ 57 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32h755zi-cm7,defmt,exti,time-driver-any,embassy-executor/time-tick-32768hz,unstable-traits \
58 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32l476vg,defmt,exti,time-driver-any,embassy/time-tick-32768hz \ 58 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32l476vg,defmt,exti,time-driver-any,embassy-executor/time-tick-32768hz \
59 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32l476vg,defmt,exti,time-driver-any,embassy/time-tick-32768hz,unstable-traits \ 59 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32l476vg,defmt,exti,time-driver-any,embassy-executor/time-tick-32768hz,unstable-traits \
60 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32l072cz,defmt,exti,time-driver-any,embassy/time-tick-32768hz \ 60 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32l072cz,defmt,exti,time-driver-any,embassy-executor/time-tick-32768hz \
61 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32l072cz,defmt,exti,time-driver-any,embassy/time-tick-32768hz,unstable-traits \ 61 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32l072cz,defmt,exti,time-driver-any,embassy-executor/time-tick-32768hz,unstable-traits \
62 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7m-none-eabi --features stm32l151cb-a,defmt,exti,time-driver-any,embassy/time-tick-32768hz \ 62 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7m-none-eabi --features stm32l151cb-a,defmt,exti,time-driver-any,embassy-executor/time-tick-32768hz \
63 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7m-none-eabi --features stm32l151cb-a,defmt,exti,time-driver-any,embassy/time-tick-32768hz,unstable-traits \ 63 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7m-none-eabi --features stm32l151cb-a,defmt,exti,time-driver-any,embassy-executor/time-tick-32768hz,unstable-traits \
64 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7m-none-eabi --features stm32f217zg,defmt,exti,time-driver-any,embassy/time-tick-32768hz \ 64 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7m-none-eabi --features stm32f217zg,defmt,exti,time-driver-any,embassy-executor/time-tick-32768hz \
65 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7m-none-eabi --features stm32f217zg,defmt,exti,time-driver-any,embassy/time-tick-32768hz,unstable-traits \ 65 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7m-none-eabi --features stm32f217zg,defmt,exti,time-driver-any,embassy-executor/time-tick-32768hz,unstable-traits \
66 --- build --release --manifest-path examples/nrf/Cargo.toml --target thumbv7em-none-eabi --no-default-features --out-dir out/examples/nrf --bin raw_spawn \ 66 --- build --release --manifest-path examples/nrf/Cargo.toml --target thumbv7em-none-eabi --no-default-features --out-dir out/examples/nrf --bin raw_spawn \
67 --- build --release --manifest-path examples/stm32l0/Cargo.toml --target thumbv6m-none-eabi --no-default-features --out-dir out/examples/stm32l0 --bin raw_spawn \ 67 --- build --release --manifest-path examples/stm32l0/Cargo.toml --target thumbv6m-none-eabi --no-default-features --out-dir out/examples/stm32l0 --bin raw_spawn \
diff --git a/docs/modules/ROOT/examples/basic/Cargo.toml b/docs/modules/ROOT/examples/basic/Cargo.toml
index ed1c3cb1c..59e1a437a 100644
--- a/docs/modules/ROOT/examples/basic/Cargo.toml
+++ b/docs/modules/ROOT/examples/basic/Cargo.toml
@@ -5,7 +5,7 @@ name = "embassy-basic-example"
5version = "0.1.0" 5version = "0.1.0"
6 6
7[dependencies] 7[dependencies]
8embassy = { version = "0.1.0", path = "../../../../../embassy", features = ["defmt", "nightly"] } 8embassy-executor = { version = "0.1.0", path = "../../../../../embassy-executor", features = ["defmt", "nightly"] }
9embassy-nrf = { version = "0.1.0", path = "../../../../../embassy-nrf", features = ["defmt", "nrf52840", "time-driver-rtc1", "gpiote", "nightly"] } 9embassy-nrf = { version = "0.1.0", path = "../../../../../embassy-nrf", features = ["defmt", "nrf52840", "time-driver-rtc1", "gpiote", "nightly"] }
10 10
11defmt = "0.3" 11defmt = "0.3"
diff --git a/docs/modules/ROOT/examples/basic/src/main.rs b/docs/modules/ROOT/examples/basic/src/main.rs
index 461741fd7..cec39fd91 100644
--- a/docs/modules/ROOT/examples/basic/src/main.rs
+++ b/docs/modules/ROOT/examples/basic/src/main.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_nrf::gpio::{Level, Output, OutputDrive}; 8use embassy_nrf::gpio::{Level, Output, OutputDrive};
9use embassy_nrf::peripherals::P0_13; 9use embassy_nrf::peripherals::P0_13;
10use embassy_nrf::Peripherals; 10use embassy_nrf::Peripherals;
11use {defmt_rtt as _, panic_probe as _}; // global logger 11use {defmt_rtt as _, panic_probe as _}; // global logger
12 12
13#[embassy::task] 13#[embassy_executor::task]
14async fn blinker(mut led: Output<'static, P0_13>, interval: Duration) { 14async fn blinker(mut led: Output<'static, P0_13>, interval: Duration) {
15 loop { 15 loop {
16 led.set_high(); 16 led.set_high();
@@ -20,7 +20,7 @@ async fn blinker(mut led: Output<'static, P0_13>, interval: Duration) {
20 } 20 }
21} 21}
22 22
23#[embassy::main] 23#[embassy_executor::main]
24async fn main(spawner: Spawner, p: Peripherals) { 24async fn main(spawner: Spawner, p: Peripherals) {
25 let led = Output::new(p.P0_13, Level::Low, OutputDrive::Standard); 25 let led = Output::new(p.P0_13, Level::Low, OutputDrive::Standard);
26 unwrap!(spawner.spawn(blinker(led, Duration::from_millis(300)))); 26 unwrap!(spawner.spawn(blinker(led, Duration::from_millis(300))));
diff --git a/docs/modules/ROOT/examples/layer-by-layer/Cargo.toml b/docs/modules/ROOT/examples/layer-by-layer/Cargo.toml
index 2dca3cc8d..9048d9302 100644
--- a/docs/modules/ROOT/examples/layer-by-layer/Cargo.toml
+++ b/docs/modules/ROOT/examples/layer-by-layer/Cargo.toml
@@ -8,7 +8,7 @@ members = [
8] 8]
9 9
10[patch.crates-io] 10[patch.crates-io]
11embassy = { path = "../../../../../embassy" } 11embassy-executor = { path = "../../../../../embassy-executor" }
12embassy-stm32 = { path = "../../../../../embassy-stm32" } 12embassy-stm32 = { path = "../../../../../embassy-stm32" }
13stm32-metapac = { path = "../../../../../stm32-metapac" } 13stm32-metapac = { path = "../../../../../stm32-metapac" }
14 14
diff --git a/docs/modules/ROOT/examples/layer-by-layer/blinky-async/Cargo.toml b/docs/modules/ROOT/examples/layer-by-layer/blinky-async/Cargo.toml
index e0c63251e..e2933076f 100644
--- a/docs/modules/ROOT/examples/layer-by-layer/blinky-async/Cargo.toml
+++ b/docs/modules/ROOT/examples/layer-by-layer/blinky-async/Cargo.toml
@@ -7,7 +7,7 @@ edition = "2021"
7cortex-m = "0.7" 7cortex-m = "0.7"
8cortex-m-rt = "0.7" 8cortex-m-rt = "0.7"
9embassy-stm32 = { version = "0.1.0", features = ["stm32l475vg", "memory-x", "exti"], default-features = false } 9embassy-stm32 = { version = "0.1.0", features = ["stm32l475vg", "memory-x", "exti"], default-features = false }
10embassy = { version = "0.1.0", default-features = false, features = ["nightly"] } 10embassy-executor = { version = "0.1.0", default-features = false, features = ["nightly"] }
11 11
12defmt = "0.3.0" 12defmt = "0.3.0"
13defmt-rtt = "0.3.0" 13defmt-rtt = "0.3.0"
diff --git a/docs/modules/ROOT/examples/layer-by-layer/blinky-async/src/main.rs b/docs/modules/ROOT/examples/layer-by-layer/blinky-async/src/main.rs
index 56bc698da..b944a7994 100644
--- a/docs/modules/ROOT/examples/layer-by-layer/blinky-async/src/main.rs
+++ b/docs/modules/ROOT/examples/layer-by-layer/blinky-async/src/main.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_stm32::exti::ExtiInput; 6use embassy_stm32::exti::ExtiInput;
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(_s: Spawner, p: Peripherals) { 12async fn main(_s: Spawner, p: Peripherals) {
13 let mut led = Output::new(p.PB14, Level::Low, Speed::VeryHigh); 13 let mut led = Output::new(p.PB14, Level::Low, Speed::VeryHigh);
14 let mut button = ExtiInput::new(Input::new(p.PC13, Pull::Up), p.EXTI13); 14 let mut button = ExtiInput::new(Input::new(p.PC13, Pull::Up), p.EXTI13);
diff --git a/embassy-boot/boot/Cargo.toml b/embassy-boot/boot/Cargo.toml
index 5bb2c34b3..abb7bb5c2 100644
--- a/embassy-boot/boot/Cargo.toml
+++ b/embassy-boot/boot/Cargo.toml
@@ -9,7 +9,7 @@ description = "Bootloader using Embassy"
9[dependencies] 9[dependencies]
10defmt = { version = "0.3", optional = true } 10defmt = { version = "0.3", optional = true }
11log = { version = "0.4", optional = true } 11log = { version = "0.4", optional = true }
12embassy = { path = "../../embassy", default-features = false } 12embassy-util = { version = "0.1.0", path = "../../embassy-util" }
13embedded-storage = "0.3.0" 13embedded-storage = "0.3.0"
14embedded-storage-async = "0.3.0" 14embedded-storage-async = "0.3.0"
15 15
diff --git a/embassy-boot/nrf/Cargo.toml b/embassy-boot/nrf/Cargo.toml
index ea5794836..5dc3ce52b 100644
--- a/embassy-boot/nrf/Cargo.toml
+++ b/embassy-boot/nrf/Cargo.toml
@@ -9,7 +9,7 @@ description = "Bootloader lib for nRF chips"
9[dependencies] 9[dependencies]
10defmt = { version = "0.3", optional = true } 10defmt = { version = "0.3", optional = true }
11 11
12embassy = { path = "../../embassy", default-features = false } 12embassy-util = { path = "../../embassy-util" }
13embassy-nrf = { path = "../../embassy-nrf", default-features = false, features = ["nightly"] } 13embassy-nrf = { path = "../../embassy-nrf", default-features = false, features = ["nightly"] }
14embassy-boot = { path = "../boot", default-features = false } 14embassy-boot = { path = "../boot", default-features = false }
15cortex-m = { version = "0.7" } 15cortex-m = { version = "0.7" }
diff --git a/embassy-boot/stm32/Cargo.toml b/embassy-boot/stm32/Cargo.toml
index 13ae54b31..eab8d160a 100644
--- a/embassy-boot/stm32/Cargo.toml
+++ b/embassy-boot/stm32/Cargo.toml
@@ -11,7 +11,7 @@ defmt = { version = "0.3", optional = true }
11defmt-rtt = { version = "0.3", optional = true } 11defmt-rtt = { version = "0.3", optional = true }
12log = { version = "0.4", optional = true } 12log = { version = "0.4", optional = true }
13 13
14embassy = { path = "../../embassy", default-features = false } 14embassy-util = { path = "../../embassy-util" }
15embassy-stm32 = { path = "../../embassy-stm32", default-features = false, features = ["nightly"] } 15embassy-stm32 = { path = "../../embassy-stm32", default-features = false, features = ["nightly"] }
16embassy-boot = { path = "../boot", default-features = false } 16embassy-boot = { path = "../boot", default-features = false }
17cortex-m = { version = "0.7" } 17cortex-m = { version = "0.7" }
diff --git a/embassy-cortex-m/Cargo.toml b/embassy-cortex-m/Cargo.toml
index 9dbec0462..454f34e0b 100644
--- a/embassy-cortex-m/Cargo.toml
+++ b/embassy-cortex-m/Cargo.toml
@@ -35,7 +35,8 @@ prio-bits-8 = []
35defmt = { version = "0.3", optional = true } 35defmt = { version = "0.3", optional = true }
36log = { version = "0.4.14", optional = true } 36log = { version = "0.4.14", optional = true }
37 37
38embassy = { version = "0.1.0", path = "../embassy"} 38embassy-util = { version = "0.1.0", path = "../embassy-util" }
39embassy-executor = { version = "0.1.0", path = "../embassy-executor"}
39embassy-macros = { version = "0.1.0", path = "../embassy-macros"} 40embassy-macros = { version = "0.1.0", path = "../embassy-macros"}
40embassy-hal-common = { version = "0.1.0", path = "../embassy-hal-common"} 41embassy-hal-common = { version = "0.1.0", path = "../embassy-hal-common"}
41atomic-polyfill = "0.1.5" 42atomic-polyfill = "0.1.5"
diff --git a/embassy-cortex-m/src/executor.rs b/embassy-cortex-m/src/executor.rs
index 17ccf0e81..4a3fa9903 100644
--- a/embassy-cortex-m/src/executor.rs
+++ b/embassy-cortex-m/src/executor.rs
@@ -1,7 +1,7 @@
1//! Executor specific to cortex-m devices. 1//! Executor specific to cortex-m devices.
2use core::marker::PhantomData; 2use core::marker::PhantomData;
3 3
4pub use embassy::executor::*; 4pub use embassy_executor::executor::*;
5 5
6use crate::interrupt::{Interrupt, InterruptExt}; 6use crate::interrupt::{Interrupt, InterruptExt};
7 7
@@ -60,18 +60,18 @@ impl<I: Interrupt> InterruptExecutor<I> {
60 /// The executor keeps running in the background through the interrupt. 60 /// The executor keeps running in the background through the interrupt.
61 /// 61 ///
62 /// This returns a [`SendSpawner`] you can use to spawn tasks on it. A [`SendSpawner`] 62 /// This returns a [`SendSpawner`] you can use to spawn tasks on it. A [`SendSpawner`]
63 /// is returned instead of a [`Spawner`](embassy::executor::Spawner) because the executor effectively runs in a 63 /// is returned instead of a [`Spawner`](embassy_executor::executor::Spawner) because the executor effectively runs in a
64 /// different "thread" (the interrupt), so spawning tasks on it is effectively 64 /// different "thread" (the interrupt), so spawning tasks on it is effectively
65 /// sending them. 65 /// sending them.
66 /// 66 ///
67 /// To obtain a [`Spawner`](embassy::executor::Spawner) for this executor, use [`Spawner::for_current_executor()`](embassy::executor::Spawner::for_current_executor()) from 67 /// To obtain a [`Spawner`](embassy_executor::executor::Spawner) for this executor, use [`Spawner::for_current_executor()`](embassy_executor::executor::Spawner::for_current_executor()) from
68 /// a task running in it. 68 /// a task running in it.
69 /// 69 ///
70 /// This function requires `&'static mut self`. This means you have to store the 70 /// This function requires `&'static mut self`. This means you have to store the
71 /// Executor instance in a place where it'll live forever and grants you mutable 71 /// Executor instance in a place where it'll live forever and grants you mutable
72 /// access. There's a few ways to do this: 72 /// access. There's a few ways to do this:
73 /// 73 ///
74 /// - a [Forever](embassy::util::Forever) (safe) 74 /// - a [Forever](embassy_util::Forever) (safe)
75 /// - a `static mut` (unsafe) 75 /// - a `static mut` (unsafe)
76 /// - a local variable in a function you know never returns (like `fn main() -> !`), upgrading its lifetime with `transmute`. (unsafe) 76 /// - a local variable in a function you know never returns (like `fn main() -> !`), upgrading its lifetime with `transmute`. (unsafe)
77 pub fn start(&'static mut self) -> SendSpawner { 77 pub fn start(&'static mut self) -> SendSpawner {
diff --git a/embassy-embedded-hal/Cargo.toml b/embassy-embedded-hal/Cargo.toml
index 455786be9..f245783cf 100644
--- a/embassy-embedded-hal/Cargo.toml
+++ b/embassy-embedded-hal/Cargo.toml
@@ -9,7 +9,7 @@ std = []
9nightly = ["embedded-hal-async", "embedded-storage-async"] 9nightly = ["embedded-hal-async", "embedded-storage-async"]
10 10
11[dependencies] 11[dependencies]
12embassy = { version = "0.1.0", path = "../embassy" } 12embassy-util = { version = "0.1.0", path = "../embassy-util" }
13embedded-hal-02 = { package = "embedded-hal", version = "0.2.6", features = ["unproven"] } 13embedded-hal-02 = { package = "embedded-hal", version = "0.2.6", features = ["unproven"] }
14embedded-hal-1 = { package = "embedded-hal", version = "1.0.0-alpha.8" } 14embedded-hal-1 = { package = "embedded-hal", version = "1.0.0-alpha.8" }
15embedded-hal-async = { version = "0.1.0-alpha.1", optional = true } 15embedded-hal-async = { version = "0.1.0-alpha.1", optional = true }
diff --git a/embassy-embedded-hal/src/shared_bus/asynch/i2c.rs b/embassy-embedded-hal/src/shared_bus/asynch/i2c.rs
index fa77a06d3..bd023fb6a 100644
--- a/embassy-embedded-hal/src/shared_bus/asynch/i2c.rs
+++ b/embassy-embedded-hal/src/shared_bus/asynch/i2c.rs
@@ -4,8 +4,8 @@
4//! 4//!
5//! ```rust 5//! ```rust
6//! use embassy_embedded_hal::shared_bus::i2c::I2cDevice; 6//! use embassy_embedded_hal::shared_bus::i2c::I2cDevice;
7//! use embassy::mutex::Mutex; 7//! use embassy_util::mutex::Mutex;
8//! use embassy::blocking_mutex::raw::ThreadModeRawMutex; 8//! use embassy_util::blocking_mutex::raw::ThreadModeRawMutex;
9//! 9//!
10//! static I2C_BUS: Forever<Mutex::<ThreadModeRawMutex, Twim<TWISPI0>>> = Forever::new(); 10//! static I2C_BUS: Forever<Mutex::<ThreadModeRawMutex, Twim<TWISPI0>>> = Forever::new();
11//! let config = twim::Config::default(); 11//! let config = twim::Config::default();
@@ -24,8 +24,8 @@
24//! ``` 24//! ```
25use core::future::Future; 25use core::future::Future;
26 26
27use embassy::blocking_mutex::raw::RawMutex; 27use embassy_util::blocking_mutex::raw::RawMutex;
28use embassy::mutex::Mutex; 28use embassy_util::mutex::Mutex;
29use embedded_hal_async::i2c; 29use embedded_hal_async::i2c;
30 30
31use crate::shared_bus::I2cDeviceError; 31use crate::shared_bus::I2cDeviceError;
diff --git a/embassy-embedded-hal/src/shared_bus/asynch/spi.rs b/embassy-embedded-hal/src/shared_bus/asynch/spi.rs
index a08eaa82d..caa37f6f3 100644
--- a/embassy-embedded-hal/src/shared_bus/asynch/spi.rs
+++ b/embassy-embedded-hal/src/shared_bus/asynch/spi.rs
@@ -4,8 +4,8 @@
4//! 4//!
5//! ```rust 5//! ```rust
6//! use embassy_embedded_hal::shared_bus::spi::SpiDevice; 6//! use embassy_embedded_hal::shared_bus::spi::SpiDevice;
7//! use embassy::mutex::Mutex; 7//! use embassy_util::mutex::Mutex;
8//! use embassy::blocking_mutex::raw::ThreadModeRawMutex; 8//! use embassy_util::blocking_mutex::raw::ThreadModeRawMutex;
9//! 9//!
10//! static SPI_BUS: Forever<Mutex<ThreadModeRawMutex, spim::Spim<SPI3>>> = Forever::new(); 10//! static SPI_BUS: Forever<Mutex<ThreadModeRawMutex, spim::Spim<SPI3>>> = Forever::new();
11//! let mut config = spim::Config::default(); 11//! let mut config = spim::Config::default();
@@ -27,8 +27,8 @@
27//! ``` 27//! ```
28use core::future::Future; 28use core::future::Future;
29 29
30use embassy::blocking_mutex::raw::RawMutex; 30use embassy_util::blocking_mutex::raw::RawMutex;
31use embassy::mutex::Mutex; 31use embassy_util::mutex::Mutex;
32use embedded_hal_1::digital::blocking::OutputPin; 32use embedded_hal_1::digital::blocking::OutputPin;
33use embedded_hal_1::spi::ErrorType; 33use embedded_hal_1::spi::ErrorType;
34use embedded_hal_async::spi; 34use embedded_hal_async::spi;
diff --git a/embassy-embedded-hal/src/shared_bus/blocking/i2c.rs b/embassy-embedded-hal/src/shared_bus/blocking/i2c.rs
index c8b5e30f6..1fc343d15 100644
--- a/embassy-embedded-hal/src/shared_bus/blocking/i2c.rs
+++ b/embassy-embedded-hal/src/shared_bus/blocking/i2c.rs
@@ -4,7 +4,7 @@
4//! 4//!
5//! ```rust 5//! ```rust
6//! use embassy_embedded_hal::shared_bus::blocking::i2c::I2cDevice; 6//! use embassy_embedded_hal::shared_bus::blocking::i2c::I2cDevice;
7//! use embassy::blocking_mutex::{NoopMutex, raw::NoopRawMutex}; 7//! use embassy_util::blocking_mutex::{NoopMutex, raw::NoopRawMutex};
8//! 8//!
9//! static I2C_BUS: Forever<NoopMutex<RefCell<Twim<TWISPI0>>>> = Forever::new(); 9//! static I2C_BUS: Forever<NoopMutex<RefCell<Twim<TWISPI0>>>> = Forever::new();
10//! let irq = interrupt::take!(SPIM0_SPIS0_TWIM0_TWIS0_SPI0_TWI0); 10//! let irq = interrupt::take!(SPIM0_SPIS0_TWIM0_TWIS0_SPI0_TWI0);
@@ -18,8 +18,8 @@
18 18
19use core::cell::RefCell; 19use core::cell::RefCell;
20 20
21use embassy::blocking_mutex::raw::RawMutex; 21use embassy_util::blocking_mutex::raw::RawMutex;
22use embassy::blocking_mutex::Mutex; 22use embassy_util::blocking_mutex::Mutex;
23use embedded_hal_1::i2c::blocking::{I2c, Operation}; 23use embedded_hal_1::i2c::blocking::{I2c, Operation};
24use embedded_hal_1::i2c::ErrorType; 24use embedded_hal_1::i2c::ErrorType;
25 25
diff --git a/embassy-embedded-hal/src/shared_bus/blocking/spi.rs b/embassy-embedded-hal/src/shared_bus/blocking/spi.rs
index d0648f59a..a61326594 100644
--- a/embassy-embedded-hal/src/shared_bus/blocking/spi.rs
+++ b/embassy-embedded-hal/src/shared_bus/blocking/spi.rs
@@ -4,7 +4,7 @@
4//! 4//!
5//! ```rust 5//! ```rust
6//! use embassy_embedded_hal::shared_bus::blocking::spi::SpiDevice; 6//! use embassy_embedded_hal::shared_bus::blocking::spi::SpiDevice;
7//! use embassy::blocking_mutex::{NoopMutex, raw::NoopRawMutex}; 7//! use embassy_util::blocking_mutex::{NoopMutex, raw::NoopRawMutex};
8//! 8//!
9//! static SPI_BUS: Forever<NoopMutex<RefCell<Spim<SPI3>>>> = Forever::new(); 9//! static SPI_BUS: Forever<NoopMutex<RefCell<Spim<SPI3>>>> = Forever::new();
10//! let irq = interrupt::take!(SPIM3); 10//! let irq = interrupt::take!(SPIM3);
@@ -20,8 +20,8 @@
20 20
21use core::cell::RefCell; 21use core::cell::RefCell;
22 22
23use embassy::blocking_mutex::raw::RawMutex; 23use embassy_util::blocking_mutex::raw::RawMutex;
24use embassy::blocking_mutex::Mutex; 24use embassy_util::blocking_mutex::Mutex;
25use embedded_hal_1::digital::blocking::OutputPin; 25use embedded_hal_1::digital::blocking::OutputPin;
26use embedded_hal_1::spi; 26use embedded_hal_1::spi;
27use embedded_hal_1::spi::blocking::SpiBusFlush; 27use embedded_hal_1::spi::blocking::SpiBusFlush;
diff --git a/embassy/Cargo.toml b/embassy-executor/Cargo.toml
index a5d36c10c..d8ac4ac00 100644
--- a/embassy/Cargo.toml
+++ b/embassy-executor/Cargo.toml
@@ -1,11 +1,12 @@
1[package] 1[package]
2name = "embassy" 2name = "embassy-executor"
3version = "0.1.0" 3version = "0.1.0"
4edition = "2021" 4edition = "2021"
5 5
6
6[package.metadata.embassy_docs] 7[package.metadata.embassy_docs]
7src_base = "https://github.com/embassy-rs/embassy/blob/embassy-v$VERSION/embassy/src/" 8src_base = "https://github.com/embassy-rs/embassy/blob/embassy-executor-v$VERSION/embassy-executor/src/"
8src_base_git = "https://github.com/embassy-rs/embassy/blob/$COMMIT/embassy/src/" 9src_base_git = "https://github.com/embassy-rs/embassy/blob/$COMMIT/embassy-executor/src/"
9features = ["nightly", "defmt", "unstable-traits", "time", "time-tick-1mhz"] 10features = ["nightly", "defmt", "unstable-traits", "time", "time-tick-1mhz"]
10flavors = [ 11flavors = [
11 { name = "std", target = "x86_64-unknown-linux-gnu", features = ["std"] }, 12 { name = "std", target = "x86_64-unknown-linux-gnu", features = ["std"] },
@@ -21,7 +22,7 @@ flavors = [
21 22
22[features] 23[features]
23default = [] 24default = []
24std = ["futures/std", "time", "time-tick-1mhz", "embassy-macros/std"] 25std = ["time", "time-tick-1mhz", "embassy-macros/std"]
25wasm = ["wasm-bindgen", "js-sys", "embassy-macros/wasm", "wasm-timer", "time", "time-tick-1mhz"] 26wasm = ["wasm-bindgen", "js-sys", "embassy-macros/wasm", "wasm-timer", "time", "time-tick-1mhz"]
26 27
27# Enable nightly-only features 28# Enable nightly-only features
@@ -35,12 +36,12 @@ unstable-traits = ["embedded-hal-1"]
35# To use this you must have a time driver provided. 36# To use this you must have a time driver provided.
36defmt-timestamp-uptime = ["defmt"] 37defmt-timestamp-uptime = ["defmt"]
37 38
38# Enable `embassy::time` module. 39# Enable `embassy_executor::time` module.
39# NOTE: This feature is only intended to be enabled by crates providing the time driver implementation. 40# NOTE: This feature is only intended to be enabled by crates providing the time driver implementation.
40# Enabling it directly without supplying a time driver will fail to link. 41# Enabling it directly without supplying a time driver will fail to link.
41time = [] 42time = []
42 43
43# Set the `embassy::time` tick rate. 44# Set the `embassy_executor::time` tick rate.
44# NOTE: This feature is only intended to be enabled by crates providing the time driver implementation. 45# NOTE: This feature is only intended to be enabled by crates providing the time driver implementation.
45# If you're not writing your own driver, check the driver documentation to customize the tick rate. 46# If you're not writing your own driver, check the driver documentation to customize the tick rate.
46# If you're writing a driver and your tick rate is not listed here, please add it and send a PR! 47# If you're writing a driver and your tick rate is not listed here, please add it and send a PR!
@@ -49,8 +50,6 @@ time-tick-1000hz = ["time"]
49time-tick-1mhz = ["time"] 50time-tick-1mhz = ["time"]
50time-tick-16mhz = ["time"] 51time-tick-16mhz = ["time"]
51 52
52executor-agnostic = []
53
54[dependencies] 53[dependencies]
55defmt = { version = "0.3", optional = true } 54defmt = { version = "0.3", optional = true }
56log = { version = "0.4.14", optional = true } 55log = { version = "0.4.14", optional = true }
@@ -59,37 +58,13 @@ embedded-hal-02 = { package = "embedded-hal", version = "0.2.6" }
59embedded-hal-1 = { package = "embedded-hal", version = "1.0.0-alpha.8", optional = true} 58embedded-hal-1 = { package = "embedded-hal", version = "1.0.0-alpha.8", optional = true}
60embedded-hal-async = { version = "0.1.0-alpha.1", optional = true} 59embedded-hal-async = { version = "0.1.0-alpha.1", optional = true}
61 60
62futures = { version = "0.3.17", default-features = false, features = [ "cfg-target-has-atomic", "unstable" ] } 61futures-util = { version = "0.3.17", default-features = false }
63pin-project = { version = "1.0.8", default-features = false }
64embassy-macros = { version = "0.1.0", path = "../embassy-macros"} 62embassy-macros = { version = "0.1.0", path = "../embassy-macros"}
65atomic-polyfill = "0.1.5" 63atomic-polyfill = "0.1.5"
66critical-section = "0.2.5" 64critical-section = "0.2.5"
67heapless = "0.7.5"
68cfg-if = "1.0.0" 65cfg-if = "1.0.0"
69 66
70# WASM dependencies 67# WASM dependencies
71wasm-bindgen = { version = "0.2.76", features = ["nightly"], optional = true } 68wasm-bindgen = { version = "0.2.76", features = ["nightly"], optional = true }
72js-sys = { version = "0.3", optional = true } 69js-sys = { version = "0.3", optional = true }
73wasm-timer = { version = "0.2.5", optional = true } 70wasm-timer = { version = "0.2.5", optional = true } \ No newline at end of file
74
75[target."thumbv6m-none-eabi".dependencies]
76cortex-m = "0.7.3"
77[target."thumbv7m-none-eabi".dependencies]
78cortex-m = "0.7.3"
79[target."thumbv7em-none-eabi".dependencies]
80cortex-m = "0.7.3"
81[target."thumbv7em-none-eabihf".dependencies]
82cortex-m = "0.7.3"
83[target."thumbv8m.base-none-eabi".dependencies]
84cortex-m = "0.7.3"
85[target."thumbv8m.main-none-eabi".dependencies]
86cortex-m = "0.7.3"
87[target."thumbv8m.main-none-eabihf".dependencies]
88cortex-m = "0.7.3"
89
90[dev-dependencies]
91embassy = { path = ".", features = ["executor-agnostic"] }
92futures-executor = { version = "0.3.17", features = [ "thread-pool" ] }
93futures-test = "0.3.17"
94futures-timer = "3.0.2"
95futures-util = { version = "0.3.17", features = [ "channel" ] }
diff --git a/embassy/build.rs b/embassy-executor/build.rs
index 6fe82b44f..6fe82b44f 100644
--- a/embassy/build.rs
+++ b/embassy-executor/build.rs
diff --git a/embassy/src/executor/arch/cortex_m.rs b/embassy-executor/src/executor/arch/cortex_m.rs
index cf80389b6..d6e758dfb 100644
--- a/embassy/src/executor/arch/cortex_m.rs
+++ b/embassy-executor/src/executor/arch/cortex_m.rs
@@ -1,3 +1,4 @@
1use core::arch::asm;
1use core::marker::PhantomData; 2use core::marker::PhantomData;
2use core::ptr; 3use core::ptr;
3 4
@@ -22,7 +23,7 @@ impl Executor {
22 /// Create a new Executor. 23 /// Create a new Executor.
23 pub fn new() -> Self { 24 pub fn new() -> Self {
24 Self { 25 Self {
25 inner: raw::Executor::new(|_| cortex_m::asm::sev(), ptr::null_mut()), 26 inner: raw::Executor::new(|_| unsafe { asm!("sev") }, ptr::null_mut()),
26 not_send: PhantomData, 27 not_send: PhantomData,
27 } 28 }
28 } 29 }
@@ -49,8 +50,10 @@ impl Executor {
49 init(self.inner.spawner()); 50 init(self.inner.spawner());
50 51
51 loop { 52 loop {
52 unsafe { self.inner.poll() }; 53 unsafe {
53 cortex_m::asm::wfe(); 54 self.inner.poll();
55 asm!("wfe");
56 };
54 } 57 }
55 } 58 }
56} 59}
diff --git a/embassy/src/executor/arch/riscv32.rs b/embassy-executor/src/executor/arch/riscv32.rs
index 7a7d5698c..7a7d5698c 100644
--- a/embassy/src/executor/arch/riscv32.rs
+++ b/embassy-executor/src/executor/arch/riscv32.rs
diff --git a/embassy/src/executor/arch/std.rs b/embassy-executor/src/executor/arch/std.rs
index b93ab8a79..b93ab8a79 100644
--- a/embassy/src/executor/arch/std.rs
+++ b/embassy-executor/src/executor/arch/std.rs
diff --git a/embassy/src/executor/arch/wasm.rs b/embassy-executor/src/executor/arch/wasm.rs
index 9d5aa31ed..9d5aa31ed 100644
--- a/embassy/src/executor/arch/wasm.rs
+++ b/embassy-executor/src/executor/arch/wasm.rs
diff --git a/embassy/src/executor/arch/xtensa.rs b/embassy-executor/src/executor/arch/xtensa.rs
index 20bd7b8a5..20bd7b8a5 100644
--- a/embassy/src/executor/arch/xtensa.rs
+++ b/embassy-executor/src/executor/arch/xtensa.rs
diff --git a/embassy/src/executor/mod.rs b/embassy-executor/src/executor/mod.rs
index 758269363..45d00c568 100644
--- a/embassy/src/executor/mod.rs
+++ b/embassy-executor/src/executor/mod.rs
@@ -10,8 +10,6 @@
10//! - Fair: a task can't monopolize CPU time even if it's constantly being woken. All other tasks get a chance to run before a given task gets polled for the second time. 10//! - Fair: a task can't monopolize CPU time even if it's constantly being woken. All other tasks get a chance to run before a given task gets polled for the second time.
11//! - Creating multiple executor instances is supported, to run tasks with multiple priority levels. This allows higher-priority tasks to preempt lower-priority tasks. 11//! - Creating multiple executor instances is supported, to run tasks with multiple priority levels. This allows higher-priority tasks to preempt lower-priority tasks.
12 12
13#![deny(missing_docs)]
14
15cfg_if::cfg_if! { 13cfg_if::cfg_if! {
16 if #[cfg(cortex_m)] { 14 if #[cfg(cortex_m)] {
17 #[path="arch/cortex_m.rs"] 15 #[path="arch/cortex_m.rs"]
diff --git a/embassy/src/executor/raw/mod.rs b/embassy-executor/src/executor/raw/mod.rs
index 0cfe617eb..87317bc02 100644
--- a/embassy/src/executor/raw/mod.rs
+++ b/embassy-executor/src/executor/raw/mod.rs
@@ -5,7 +5,7 @@
5//! ## WARNING: here be dragons! 5//! ## WARNING: here be dragons!
6//! 6//!
7//! Using this module requires respecting subtle safety contracts. If you can, prefer using the safe 7//! Using this module requires respecting subtle safety contracts. If you can, prefer using the safe
8//! executor wrappers in [`executor`](crate::executor) and the [`embassy::task`](embassy_macros::task) macro, which are fully safe. 8//! executor wrappers in [`executor`](crate::executor) and the [`embassy_executor::task`](embassy_macros::task) macro, which are fully safe.
9 9
10mod run_queue; 10mod run_queue;
11#[cfg(feature = "time")] 11#[cfg(feature = "time")]
@@ -99,7 +99,7 @@ impl TaskHeader {
99/// A `TaskStorage` must live forever, it may not be deallocated even after the task has finished 99/// A `TaskStorage` must live forever, it may not be deallocated even after the task has finished
100/// running. Hence the relevant methods require `&'static self`. It may be reused, however. 100/// running. Hence the relevant methods require `&'static self`. It may be reused, however.
101/// 101///
102/// Internally, the [embassy::task](embassy_macros::task) macro allocates an array of `TaskStorage`s 102/// Internally, the [embassy_executor::task](embassy_macros::task) macro allocates an array of `TaskStorage`s
103/// in a `static`. The most common reason to use the raw `Task` is to have control of where 103/// in a `static`. The most common reason to use the raw `Task` is to have control of where
104/// the memory for the task is allocated: on the stack, or on the heap with e.g. `Box::leak`, etc. 104/// the memory for the task is allocated: on the stack, or on the heap with e.g. `Box::leak`, etc.
105 105
diff --git a/embassy/src/executor/raw/run_queue.rs b/embassy-executor/src/executor/raw/run_queue.rs
index 31615da7e..31615da7e 100644
--- a/embassy/src/executor/raw/run_queue.rs
+++ b/embassy-executor/src/executor/raw/run_queue.rs
diff --git a/embassy/src/executor/raw/timer_queue.rs b/embassy-executor/src/executor/raw/timer_queue.rs
index 62fcfc531..62fcfc531 100644
--- a/embassy/src/executor/raw/timer_queue.rs
+++ b/embassy-executor/src/executor/raw/timer_queue.rs
diff --git a/embassy/src/executor/raw/util.rs b/embassy-executor/src/executor/raw/util.rs
index ed5822188..ed5822188 100644
--- a/embassy/src/executor/raw/util.rs
+++ b/embassy-executor/src/executor/raw/util.rs
diff --git a/embassy/src/executor/raw/waker.rs b/embassy-executor/src/executor/raw/waker.rs
index 605cda4ca..f6ae332fa 100644
--- a/embassy/src/executor/raw/waker.rs
+++ b/embassy-executor/src/executor/raw/waker.rs
@@ -40,7 +40,7 @@ pub fn task_from_waker(waker: &Waker) -> NonNull<TaskHeader> {
40 // TODO use waker_getters when stable. https://github.com/rust-lang/rust/issues/96992 40 // TODO use waker_getters when stable. https://github.com/rust-lang/rust/issues/96992
41 let hack: &WakerHack = unsafe { mem::transmute(waker) }; 41 let hack: &WakerHack = unsafe { mem::transmute(waker) };
42 if hack.vtable != &VTABLE { 42 if hack.vtable != &VTABLE {
43 panic!("Found waker not created by the embassy executor. Consider enabling the `executor-agnostic` feature on the `embassy` crate.") 43 panic!("Found waker not created by the Embassy executor. `embassy_executor::time::Timer` only works with the Embassy executor.")
44 } 44 }
45 45
46 // safety: we never create a waker with a null data pointer. 46 // safety: we never create a waker with a null data pointer.
diff --git a/embassy/src/executor/spawner.rs b/embassy-executor/src/executor/spawner.rs
index c8d036eb8..25a0d7dbb 100644
--- a/embassy/src/executor/spawner.rs
+++ b/embassy-executor/src/executor/spawner.rs
@@ -3,13 +3,13 @@ use core::mem;
3use core::ptr::NonNull; 3use core::ptr::NonNull;
4use core::task::Poll; 4use core::task::Poll;
5 5
6use futures::future::poll_fn; 6use futures_util::future::poll_fn;
7 7
8use super::raw; 8use super::raw;
9 9
10/// Token to spawn a newly-created task in an executor. 10/// Token to spawn a newly-created task in an executor.
11/// 11///
12/// When calling a task function (like `#[embassy::task] async fn my_task() { ... }`), the returned 12/// When calling a task function (like `#[embassy_executor::task] async fn my_task() { ... }`), the returned
13/// value is a `SpawnToken` that represents an instance of the task, ready to spawn. You must 13/// value is a `SpawnToken` that represents an instance of the task, ready to spawn. You must
14/// then spawn it into an executor, typically with [`Spawner::spawn()`]. 14/// then spawn it into an executor, typically with [`Spawner::spawn()`].
15/// 15///
@@ -56,9 +56,9 @@ impl<S> Drop for SpawnToken<S> {
56pub enum SpawnError { 56pub enum SpawnError {
57 /// Too many instances of this task are already running. 57 /// Too many instances of this task are already running.
58 /// 58 ///
59 /// By default, a task marked with `#[embassy::task]` can only have one instance 59 /// By default, a task marked with `#[embassy_executor::task]` can only have one instance
60 /// running at a time. You may allow multiple instances to run in parallel with 60 /// running at a time. You may allow multiple instances to run in parallel with
61 /// `#[embassy::task(pool_size = 4)]`, at the cost of higher RAM usage. 61 /// `#[embassy_executor::task(pool_size = 4)]`, at the cost of higher RAM usage.
62 Busy, 62 Busy,
63} 63}
64 64
@@ -101,7 +101,7 @@ impl Spawner {
101 101
102 /// Spawn a task into an executor. 102 /// Spawn a task into an executor.
103 /// 103 ///
104 /// You obtain the `token` by calling a task function (i.e. one marked with `#[embassy::task]`). 104 /// You obtain the `token` by calling a task function (i.e. one marked with `#[embassy_executor::task]`).
105 pub fn spawn<S>(&self, token: SpawnToken<S>) -> Result<(), SpawnError> { 105 pub fn spawn<S>(&self, token: SpawnToken<S>) -> Result<(), SpawnError> {
106 let task = token.raw_task; 106 let task = token.raw_task;
107 mem::forget(token); 107 mem::forget(token);
@@ -177,7 +177,7 @@ impl SendSpawner {
177 177
178 /// Spawn a task into an executor. 178 /// Spawn a task into an executor.
179 /// 179 ///
180 /// You obtain the `token` by calling a task function (i.e. one marked with `#[embassy::task]`). 180 /// You obtain the `token` by calling a task function (i.e. one marked with `#[embassy_executor::task]`).
181 pub fn spawn<S: Send>(&self, token: SpawnToken<S>) -> Result<(), SpawnError> { 181 pub fn spawn<S: Send>(&self, token: SpawnToken<S>) -> Result<(), SpawnError> {
182 let header = token.raw_task; 182 let header = token.raw_task;
183 mem::forget(token); 183 mem::forget(token);
diff --git a/embassy/src/fmt.rs b/embassy-executor/src/fmt.rs
index f8bb0a035..f8bb0a035 100644
--- a/embassy/src/fmt.rs
+++ b/embassy-executor/src/fmt.rs
diff --git a/embassy/src/lib.rs b/embassy-executor/src/lib.rs
index b7be8b34c..69e4aeb4b 100644
--- a/embassy/src/lib.rs
+++ b/embassy-executor/src/lib.rs
@@ -8,14 +8,9 @@
8// This mod MUST go first, so that the others see its macros. 8// This mod MUST go first, so that the others see its macros.
9pub(crate) mod fmt; 9pub(crate) mod fmt;
10 10
11pub mod blocking_mutex;
12pub mod channel;
13pub mod executor; 11pub mod executor;
14pub mod mutex;
15#[cfg(feature = "time")] 12#[cfg(feature = "time")]
16pub mod time; 13pub mod time;
17pub mod util;
18pub mod waitqueue;
19 14
20#[cfg(feature = "nightly")] 15#[cfg(feature = "nightly")]
21pub use embassy_macros::{main, task}; 16pub use embassy_macros::{main, task};
diff --git a/embassy/src/time/delay.rs b/embassy-executor/src/time/delay.rs
index 83a895e93..d76ed32eb 100644
--- a/embassy/src/time/delay.rs
+++ b/embassy-executor/src/time/delay.rs
@@ -35,7 +35,7 @@ cfg_if::cfg_if! {
35 if #[cfg(all(feature = "unstable-traits", feature = "nightly"))] { 35 if #[cfg(all(feature = "unstable-traits", feature = "nightly"))] {
36 use crate::time::Timer; 36 use crate::time::Timer;
37 use core::future::Future; 37 use core::future::Future;
38 use futures::FutureExt; 38 use futures_util::FutureExt;
39 39
40 impl embedded_hal_async::delay::DelayUs for Delay { 40 impl embedded_hal_async::delay::DelayUs for Delay {
41 type Error = core::convert::Infallible; 41 type Error = core::convert::Infallible;
diff --git a/embassy/src/time/driver.rs b/embassy-executor/src/time/driver.rs
index 760a828b3..48e2f1c7d 100644
--- a/embassy/src/time/driver.rs
+++ b/embassy-executor/src/time/driver.rs
@@ -1,17 +1,17 @@
1//! Time driver interface 1//! Time driver interface
2//! 2//!
3//! This module defines the interface a driver needs to implement to power the `embassy::time` module. 3//! This module defines the interface a driver needs to implement to power the `embassy_executor::time` module.
4//! 4//!
5//! # Implementing a driver 5//! # Implementing a driver
6//! 6//!
7//! - Define a struct `MyDriver` 7//! - Define a struct `MyDriver`
8//! - Implement [`Driver`] for it 8//! - Implement [`Driver`] for it
9//! - Register it as the global driver with [`time_driver_impl`]. 9//! - Register it as the global driver with [`time_driver_impl`].
10//! - Enable the Cargo features `embassy/time` and one of `embassy/time-tick-*` corresponding to the 10//! - Enable the Cargo features `embassy-executor/time` and one of `embassy-executor/time-tick-*` corresponding to the
11//! tick rate of your driver. 11//! tick rate of your driver.
12//! 12//!
13//! If you wish to make the tick rate configurable by the end user, you should do so by exposing your own 13//! If you wish to make the tick rate configurable by the end user, you should do so by exposing your own
14//! Cargo features and having each enable the corresponding `embassy/time-tick-*`. 14//! Cargo features and having each enable the corresponding `embassy-executor/time-tick-*`.
15//! 15//!
16//! # Linkage details 16//! # Linkage details
17//! 17//!
@@ -34,10 +34,10 @@
34//! # Example 34//! # Example
35//! 35//!
36//! ``` 36//! ```
37//! use embassy::time::driver::{Driver, AlarmHandle}; 37//! use embassy_executor::time::driver::{Driver, AlarmHandle};
38//! 38//!
39//! struct MyDriver{}; // not public! 39//! struct MyDriver{}; // not public!
40//! embassy::time_driver_impl!(static DRIVER: MyDriver = MyDriver{}); 40//! embassy_executor::time_driver_impl!(static DRIVER: MyDriver = MyDriver{});
41//! 41//!
42//! impl Driver for MyDriver { 42//! impl Driver for MyDriver {
43//! fn now(&self) -> u64 { 43//! fn now(&self) -> u64 {
diff --git a/embassy/src/time/driver_std.rs b/embassy-executor/src/time/driver_std.rs
index cb66f7c19..cb66f7c19 100644
--- a/embassy/src/time/driver_std.rs
+++ b/embassy-executor/src/time/driver_std.rs
diff --git a/embassy/src/time/driver_wasm.rs b/embassy-executor/src/time/driver_wasm.rs
index 5f585a19a..5f585a19a 100644
--- a/embassy/src/time/driver_wasm.rs
+++ b/embassy-executor/src/time/driver_wasm.rs
diff --git a/embassy/src/time/duration.rs b/embassy-executor/src/time/duration.rs
index dc4f16bd4..dc4f16bd4 100644
--- a/embassy/src/time/duration.rs
+++ b/embassy-executor/src/time/duration.rs
diff --git a/embassy/src/time/instant.rs b/embassy-executor/src/time/instant.rs
index 6a4925f47..6a4925f47 100644
--- a/embassy/src/time/instant.rs
+++ b/embassy-executor/src/time/instant.rs
diff --git a/embassy/src/time/mod.rs b/embassy-executor/src/time/mod.rs
index 018e01c84..b787a5cf2 100644
--- a/embassy/src/time/mod.rs
+++ b/embassy-executor/src/time/mod.rs
@@ -26,7 +26,7 @@
26//! like `2021-08-24 13:33:21`). 26//! like `2021-08-24 13:33:21`).
27//! 27//!
28//! If persistence across reboots is not needed, support can be built on top of 28//! If persistence across reboots is not needed, support can be built on top of
29//! `embassy::time` by storing the offset between "seconds elapsed since boot" 29//! `embassy_executor::time` by storing the offset between "seconds elapsed since boot"
30//! and "seconds since unix epoch". 30//! and "seconds since unix epoch".
31//! 31//!
32//! # Time driver 32//! # Time driver
@@ -35,7 +35,7 @@
35//! Only one driver can be active in a program. 35//! Only one driver can be active in a program.
36//! 36//!
37//! All methods and structs transparently call into the active driver. This makes it 37//! All methods and structs transparently call into the active driver. This makes it
38//! possible for libraries to use `embassy::time` in a driver-agnostic way without 38//! possible for libraries to use `embassy_executor::time` in a driver-agnostic way without
39//! requiring generic parameters. 39//! requiring generic parameters.
40//! 40//!
41//! For more details, check the [`driver`] module. 41//! For more details, check the [`driver`] module.
diff --git a/embassy/src/time/timer.rs b/embassy-executor/src/time/timer.rs
index 2194a4b14..b9cdb1be5 100644
--- a/embassy/src/time/timer.rs
+++ b/embassy-executor/src/time/timer.rs
@@ -2,8 +2,8 @@ use core::future::Future;
2use core::pin::Pin; 2use core::pin::Pin;
3use core::task::{Context, Poll}; 3use core::task::{Context, Poll};
4 4
5use futures::future::{select, Either}; 5use futures_util::future::{select, Either};
6use futures::{pin_mut, Stream}; 6use futures_util::{pin_mut, Stream};
7 7
8use crate::executor::raw; 8use crate::executor::raw;
9use crate::time::{Duration, Instant}; 9use crate::time::{Duration, Instant};
@@ -49,9 +49,9 @@ impl Timer {
49 /// # #![feature(type_alias_impl_trait)] 49 /// # #![feature(type_alias_impl_trait)]
50 /// # 50 /// #
51 /// # fn foo() {} 51 /// # fn foo() {}
52 /// use embassy::time::{Duration, Timer}; 52 /// use embassy_executor::time::{Duration, Timer};
53 /// 53 ///
54 /// #[embassy::task] 54 /// #[embassy_executor::task]
55 /// async fn demo_sleep_seconds() { 55 /// async fn demo_sleep_seconds() {
56 /// // suspend this task for one second. 56 /// // suspend this task for one second.
57 /// Timer::after(Duration::from_secs(1)).await; 57 /// Timer::after(Duration::from_secs(1)).await;
@@ -88,10 +88,10 @@ impl Future for Timer {
88/// ``` no_run 88/// ``` no_run
89/// # #![feature(type_alias_impl_trait)] 89/// # #![feature(type_alias_impl_trait)]
90/// # 90/// #
91/// use embassy::time::{Duration, Timer}; 91/// use embassy_executor::time::{Duration, Timer};
92/// # fn foo() {} 92/// # fn foo() {}
93/// 93///
94/// #[embassy::task] 94/// #[embassy_executor::task]
95/// async fn ticker_example_0() { 95/// async fn ticker_example_0() {
96/// loop { 96/// loop {
97/// foo(); 97/// foo();
@@ -108,11 +108,11 @@ impl Future for Timer {
108/// ``` no_run 108/// ``` no_run
109/// # #![feature(type_alias_impl_trait)] 109/// # #![feature(type_alias_impl_trait)]
110/// # 110/// #
111/// use embassy::time::{Duration, Ticker}; 111/// use embassy_executor::time::{Duration, Ticker};
112/// use futures::StreamExt; 112/// use futures::StreamExt;
113/// # fn foo(){} 113/// # fn foo(){}
114/// 114///
115/// #[embassy::task] 115/// #[embassy_executor::task]
116/// async fn ticker_example_1() { 116/// async fn ticker_example_1() {
117/// let mut ticker = Ticker::every(Duration::from_secs(1)); 117/// let mut ticker = Ticker::every(Duration::from_secs(1));
118/// loop { 118/// loop {
diff --git a/embassy-hal-common/Cargo.toml b/embassy-hal-common/Cargo.toml
index f7ebcc21e..4a6a61003 100644
--- a/embassy-hal-common/Cargo.toml
+++ b/embassy-hal-common/Cargo.toml
@@ -6,9 +6,8 @@ edition = "2021"
6[features] 6[features]
7 7
8[dependencies] 8[dependencies]
9embassy = { version = "0.1.0", path = "../embassy" }
10
11defmt = { version = "0.3", optional = true } 9defmt = { version = "0.3", optional = true }
12log = { version = "0.4.14", optional = true } 10log = { version = "0.4.14", optional = true }
13cortex-m = "0.7.3" 11
12embassy-util = { version = "0.1.0", path = "../embassy-util" }
14num-traits = { version = "0.2.14", default-features = false } 13num-traits = { version = "0.2.14", default-features = false }
diff --git a/embassy-hal-common/src/lib.rs b/embassy-hal-common/src/lib.rs
index d3d9e0a84..5d2649d02 100644
--- a/embassy-hal-common/src/lib.rs
+++ b/embassy-hal-common/src/lib.rs
@@ -10,13 +10,3 @@ mod peripheral;
10pub mod ratio; 10pub mod ratio;
11pub mod ring_buffer; 11pub mod ring_buffer;
12pub use peripheral::{Peripheral, PeripheralRef}; 12pub use peripheral::{Peripheral, PeripheralRef};
13
14/// Low power blocking wait loop using WFE/SEV.
15pub fn low_power_wait_until(mut condition: impl FnMut() -> bool) {
16 while !condition() {
17 // WFE might "eat" an event that would have otherwise woken the executor.
18 cortex_m::asm::wfe();
19 }
20 // Retrigger an event to be transparent to the executor.
21 cortex_m::asm::sev();
22}
diff --git a/embassy-lora/Cargo.toml b/embassy-lora/Cargo.toml
index 9b6b2c652..6c1b01e67 100644
--- a/embassy-lora/Cargo.toml
+++ b/embassy-lora/Cargo.toml
@@ -8,8 +8,8 @@ src_base = "https://github.com/embassy-rs/embassy/blob/embassy-lora-v$VERSION/em
8src_base_git = "https://github.com/embassy-rs/embassy/blob/$COMMIT/embassy-lora/src/" 8src_base_git = "https://github.com/embassy-rs/embassy/blob/$COMMIT/embassy-lora/src/"
9features = ["time", "defmt"] 9features = ["time", "defmt"]
10flavors = [ 10flavors = [
11 { name = "sx127x", target = "thumbv7em-none-eabihf", features = ["sx127x", "embassy-stm32/stm32wl55jc-cm4", "embassy-stm32/time-driver-any", "embassy/time-tick-32768hz"] }, 11 { name = "sx127x", target = "thumbv7em-none-eabihf", features = ["sx127x", "embassy-stm32/stm32wl55jc-cm4", "embassy-stm32/time-driver-any", "embassy-executor/time-tick-32768hz"] },
12 { name = "stm32wl", target = "thumbv7em-none-eabihf", features = ["stm32wl", "embassy-stm32/stm32wl55jc-cm4", "embassy-stm32/time-driver-any", "embassy/time-tick-32768hz"] }, 12 { name = "stm32wl", target = "thumbv7em-none-eabihf", features = ["stm32wl", "embassy-stm32/stm32wl55jc-cm4", "embassy-stm32/time-driver-any", "embassy-executor/time-tick-32768hz"] },
13] 13]
14 14
15[lib] 15[lib]
@@ -24,7 +24,8 @@ time = []
24defmt = { version = "0.3", optional = true } 24defmt = { version = "0.3", optional = true }
25log = { version = "0.4.14", optional = true } 25log = { version = "0.4.14", optional = true }
26 26
27embassy = { version = "0.1.0", path = "../embassy", default-features = false } 27embassy-executor = { version = "0.1.0", path = "../embassy-executor" }
28embassy-util = { version = "0.1.0", path = "../embassy-util" }
28embassy-stm32 = { version = "0.1.0", path = "../embassy-stm32", default-features = false, optional = true } 29embassy-stm32 = { version = "0.1.0", path = "../embassy-stm32", default-features = false, optional = true }
29embedded-hal-1 = { package = "embedded-hal", version = "1.0.0-alpha.8" } 30embedded-hal-1 = { package = "embedded-hal", version = "1.0.0-alpha.8" }
30embedded-hal-async = { version = "0.1.0-alpha.1" } 31embedded-hal-async = { version = "0.1.0-alpha.1" }
diff --git a/embassy-lora/src/lib.rs b/embassy-lora/src/lib.rs
index b2da22090..29ea45863 100644
--- a/embassy-lora/src/lib.rs
+++ b/embassy-lora/src/lib.rs
@@ -18,6 +18,6 @@ pub struct LoraTimer;
18impl lorawan_device::async_device::radio::Timer for LoraTimer { 18impl lorawan_device::async_device::radio::Timer for LoraTimer {
19 type DelayFuture<'m> = impl core::future::Future<Output = ()> + 'm; 19 type DelayFuture<'m> = impl core::future::Future<Output = ()> + 'm;
20 fn delay_ms<'m>(&'m mut self, millis: u64) -> Self::DelayFuture<'m> { 20 fn delay_ms<'m>(&'m mut self, millis: u64) -> Self::DelayFuture<'m> {
21 embassy::time::Timer::after(embassy::time::Duration::from_millis(millis)) 21 embassy_executor::time::Timer::after(embassy_executor::time::Duration::from_millis(millis))
22 } 22 }
23} 23}
diff --git a/embassy-lora/src/stm32wl/mod.rs b/embassy-lora/src/stm32wl/mod.rs
index b0d101b77..4a4c5cfb7 100644
--- a/embassy-lora/src/stm32wl/mod.rs
+++ b/embassy-lora/src/stm32wl/mod.rs
@@ -2,7 +2,6 @@
2use core::future::Future; 2use core::future::Future;
3use core::mem::MaybeUninit; 3use core::mem::MaybeUninit;
4 4
5use embassy::channel::signal::Signal;
6use embassy_hal_common::{into_ref, PeripheralRef}; 5use embassy_hal_common::{into_ref, PeripheralRef};
7use embassy_stm32::dma::NoDma; 6use embassy_stm32::dma::NoDma;
8use embassy_stm32::gpio::{AnyPin, Output}; 7use embassy_stm32::gpio::{AnyPin, Output};
@@ -13,6 +12,7 @@ use embassy_stm32::subghz::{
13 Status, SubGhz, TcxoMode, TcxoTrim, Timeout, TxParams, 12 Status, SubGhz, TcxoMode, TcxoTrim, Timeout, TxParams,
14}; 13};
15use embassy_stm32::Peripheral; 14use embassy_stm32::Peripheral;
15use embassy_util::channel::signal::Signal;
16use lorawan_device::async_device::radio::{Bandwidth, PhyRxTx, RfConfig, RxQuality, SpreadingFactor, TxConfig}; 16use lorawan_device::async_device::radio::{Bandwidth, PhyRxTx, RfConfig, RxQuality, SpreadingFactor, TxConfig};
17use lorawan_device::async_device::Timings; 17use lorawan_device::async_device::Timings;
18 18
diff --git a/embassy-lora/src/sx127x/sx127x_lora/mod.rs b/embassy-lora/src/sx127x/sx127x_lora/mod.rs
index 8b937ec2f..b3636d097 100644
--- a/embassy-lora/src/sx127x/sx127x_lora/mod.rs
+++ b/embassy-lora/src/sx127x/sx127x_lora/mod.rs
@@ -6,7 +6,7 @@
6#![allow(dead_code)] 6#![allow(dead_code)]
7 7
8use bit_field::BitField; 8use bit_field::BitField;
9use embassy::time::{Duration, Timer}; 9use embassy_executor::time::{Duration, Timer};
10use embedded_hal::digital::v2::OutputPin; 10use embedded_hal::digital::v2::OutputPin;
11use embedded_hal_async::spi::SpiBus; 11use embedded_hal_async::spi::SpiBus;
12 12
diff --git a/embassy-macros/src/macros/cortex_m_interrupt_take.rs b/embassy-macros/src/macros/cortex_m_interrupt_take.rs
index 29dca12fd..133eb5c26 100644
--- a/embassy-macros/src/macros/cortex_m_interrupt_take.rs
+++ b/embassy-macros/src/macros/cortex_m_interrupt_take.rs
@@ -16,15 +16,15 @@ pub fn run(name: syn::Ident) -> Result<TokenStream, TokenStream> {
16 static HANDLER: interrupt::Handler; 16 static HANDLER: interrupt::Handler;
17 } 17 }
18 18
19 let func = HANDLER.func.load(::embassy::export::atomic::Ordering::Relaxed); 19 let func = HANDLER.func.load(::embassy_executor::export::atomic::Ordering::Relaxed);
20 let ctx = HANDLER.ctx.load(::embassy::export::atomic::Ordering::Relaxed); 20 let ctx = HANDLER.ctx.load(::embassy_executor::export::atomic::Ordering::Relaxed);
21 let func: fn(*mut ()) = ::core::mem::transmute(func); 21 let func: fn(*mut ()) = ::core::mem::transmute(func);
22 func(ctx) 22 func(ctx)
23 } 23 }
24 24
25 static TAKEN: ::embassy::export::atomic::AtomicBool = ::embassy::export::atomic::AtomicBool::new(false); 25 static TAKEN: ::embassy_executor::export::atomic::AtomicBool = ::embassy_executor::export::atomic::AtomicBool::new(false);
26 26
27 if TAKEN.compare_exchange(false, true, ::embassy::export::atomic::Ordering::AcqRel, ::embassy::export::atomic::Ordering::Acquire).is_err() { 27 if TAKEN.compare_exchange(false, true, ::embassy_executor::export::atomic::Ordering::AcqRel, ::embassy_executor::export::atomic::Ordering::Acquire).is_err() {
28 core::panic!("IRQ Already taken"); 28 core::panic!("IRQ Already taken");
29 } 29 }
30 30
diff --git a/embassy-macros/src/macros/main.rs b/embassy-macros/src/macros/main.rs
index 5638276b2..a8c8bb0d7 100644
--- a/embassy-macros/src/macros/main.rs
+++ b/embassy-macros/src/macros/main.rs
@@ -49,14 +49,14 @@ pub fn run(args: syn::AttributeArgs, f: syn::ItemFn) -> Result<TokenStream, Toke
49 49
50 let embassy_prefix = args.embassy_prefix; 50 let embassy_prefix = args.embassy_prefix;
51 let embassy_prefix_lit = embassy_prefix.literal(); 51 let embassy_prefix_lit = embassy_prefix.literal();
52 let embassy_path = embassy_prefix.append("embassy").path(); 52 let embassy_path = embassy_prefix.append("embassy_executor").path();
53 let f_body = f.block; 53 let f_body = f.block;
54 54
55 #[cfg(feature = "wasm")] 55 #[cfg(feature = "wasm")]
56 let main = quote! { 56 let main = quote! {
57 #[wasm_bindgen::prelude::wasm_bindgen(start)] 57 #[wasm_bindgen::prelude::wasm_bindgen(start)]
58 pub fn main() -> Result<(), wasm_bindgen::JsValue> { 58 pub fn main() -> Result<(), wasm_bindgen::JsValue> {
59 static EXECUTOR: #embassy_path::util::Forever<#embassy_path::executor::Executor> = #embassy_path::util::Forever::new(); 59 static EXECUTOR: ::embassy_util::Forever<#embassy_path::executor::Executor> = ::embassy_util::Forever::new();
60 let executor = EXECUTOR.put(#embassy_path::executor::Executor::new()); 60 let executor = EXECUTOR.put(#embassy_path::executor::Executor::new());
61 61
62 executor.start(|spawner| { 62 executor.start(|spawner| {
diff --git a/embassy-macros/src/macros/task.rs b/embassy-macros/src/macros/task.rs
index 53c9af546..57087c81c 100644
--- a/embassy-macros/src/macros/task.rs
+++ b/embassy-macros/src/macros/task.rs
@@ -16,7 +16,7 @@ struct Args {
16pub fn run(args: syn::AttributeArgs, f: syn::ItemFn) -> Result<TokenStream, TokenStream> { 16pub fn run(args: syn::AttributeArgs, f: syn::ItemFn) -> Result<TokenStream, TokenStream> {
17 let args = Args::from_list(&args).map_err(|e| e.write_errors())?; 17 let args = Args::from_list(&args).map_err(|e| e.write_errors())?;
18 18
19 let embassy_prefix = args.embassy_prefix.append("embassy"); 19 let embassy_prefix = args.embassy_prefix.append("embassy_executor");
20 let embassy_path = embassy_prefix.path(); 20 let embassy_path = embassy_prefix.path();
21 21
22 let pool_size: usize = args.pool_size.unwrap_or(1); 22 let pool_size: usize = args.pool_size.unwrap_or(1);
diff --git a/embassy-net/Cargo.toml b/embassy-net/Cargo.toml
index 70acc7e4e..64cb5bd8f 100644
--- a/embassy-net/Cargo.toml
+++ b/embassy-net/Cargo.toml
@@ -7,7 +7,7 @@ edition = "2021"
7[package.metadata.embassy_docs] 7[package.metadata.embassy_docs]
8src_base = "https://github.com/embassy-rs/embassy/blob/embassy-net-v$VERSION/embassy-net/src/" 8src_base = "https://github.com/embassy-rs/embassy/blob/embassy-net-v$VERSION/embassy-net/src/"
9src_base_git = "https://github.com/embassy-rs/embassy/blob/$COMMIT/embassy-net/src/" 9src_base_git = "https://github.com/embassy-rs/embassy/blob/$COMMIT/embassy-net/src/"
10features = [ "pool-4", "defmt", "tcp", "dns", "dhcpv4", "proto-ipv6", "medium-ethernet", "medium-ip", "embassy/time", "embassy/time-tick-1mhz"] 10features = [ "pool-4", "defmt", "tcp", "dns", "dhcpv4", "proto-ipv6", "medium-ethernet", "medium-ip", "embassy-executor/time", "embassy-executor/time-tick-1mhz"]
11flavors = [ 11flavors = [
12 { name = "default", target = "thumbv7em-none-eabihf" }, 12 { name = "default", target = "thumbv7em-none-eabihf" },
13] 13]
@@ -37,7 +37,8 @@ pool-128 = []
37defmt = { version = "0.3", optional = true } 37defmt = { version = "0.3", optional = true }
38log = { version = "0.4.14", optional = true } 38log = { version = "0.4.14", optional = true }
39 39
40embassy = { version = "0.1.0", path = "../embassy" } 40embassy-executor = { version = "0.1.0", path = "../embassy-executor" }
41embassy-util = { version = "0.1.0", path = "../embassy-util" }
41embedded-io = { version = "0.3.0", features = [ "async" ] } 42embedded-io = { version = "0.3.0", features = [ "async" ] }
42 43
43managed = { version = "0.8.0", default-features = false, features = [ "map" ] } 44managed = { version = "0.8.0", default-features = false, features = [ "map" ] }
diff --git a/embassy-net/src/stack.rs b/embassy-net/src/stack.rs
index f3b1ff9d4..06bb732ff 100644
--- a/embassy-net/src/stack.rs
+++ b/embassy-net/src/stack.rs
@@ -2,8 +2,8 @@ use core::cell::UnsafeCell;
2use core::future::Future; 2use core::future::Future;
3use core::task::{Context, Poll}; 3use core::task::{Context, Poll};
4 4
5use embassy::time::{Instant, Timer}; 5use embassy_executor::time::{Instant, Timer};
6use embassy::waitqueue::WakerRegistration; 6use embassy_util::waitqueue::WakerRegistration;
7use futures::future::poll_fn; 7use futures::future::poll_fn;
8use futures::pin_mut; 8use futures::pin_mut;
9use heapless::Vec; 9use heapless::Vec;
diff --git a/embassy-nrf/Cargo.toml b/embassy-nrf/Cargo.toml
index b2b6db1cd..75780d417 100644
--- a/embassy-nrf/Cargo.toml
+++ b/embassy-nrf/Cargo.toml
@@ -16,12 +16,12 @@ flavors = [
16 16
17[features] 17[features]
18 18
19time = ["embassy/time"] 19time = ["embassy-executor/time"]
20 20
21defmt = ["dep:defmt", "embassy/defmt", "embassy-usb?/defmt", "embedded-io?/defmt", "embassy-embedded-hal/defmt"] 21defmt = ["dep:defmt", "embassy-executor/defmt", "embassy-util/defmt", "embassy-usb?/defmt", "embedded-io?/defmt", "embassy-embedded-hal/defmt"]
22 22
23# Enable nightly-only features 23# Enable nightly-only features
24nightly = ["embassy/nightly", "embedded-hal-1", "embedded-hal-async", "embassy-usb", "embedded-storage-async", "dep:embedded-io", "embassy-embedded-hal/nightly"] 24nightly = ["embedded-hal-1", "embedded-hal-async", "embassy-usb", "embedded-storage-async", "dep:embedded-io", "embassy-embedded-hal/nightly"]
25 25
26# Reexport the PAC for the currently enabled chip at `embassy_nrf::pac`. 26# Reexport the PAC for the currently enabled chip at `embassy_nrf::pac`.
27# This is unstable because semver-minor (non-breaking) releases of embassy-nrf may major-bump (breaking) the PAC version. 27# This is unstable because semver-minor (non-breaking) releases of embassy-nrf may major-bump (breaking) the PAC version.
@@ -57,14 +57,15 @@ _nrf5340-net = ["_nrf5340", "nrf5340-net-pac"]
57_nrf5340 = ["_gpio-p1", "_dppi"] 57_nrf5340 = ["_gpio-p1", "_dppi"]
58_nrf9160 = ["nrf9160-pac", "_dppi"] 58_nrf9160 = ["nrf9160-pac", "_dppi"]
59 59
60_time-driver = ["embassy/time-tick-32768hz", "time"] 60_time-driver = ["embassy-executor/time-tick-32768hz", "time"]
61 61
62_ppi = [] 62_ppi = []
63_dppi = [] 63_dppi = []
64_gpio-p1 = [] 64_gpio-p1 = []
65 65
66[dependencies] 66[dependencies]
67embassy = { version = "0.1.0", path = "../embassy" } 67embassy-executor = { version = "0.1.0", path = "../embassy-executor", optional = true }
68embassy-util = { version = "0.1.0", path = "../embassy-util" }
68embassy-cortex-m = { version = "0.1.0", path = "../embassy-cortex-m", features = ["prio-bits-3"]} 69embassy-cortex-m = { version = "0.1.0", path = "../embassy-cortex-m", features = ["prio-bits-3"]}
69embassy-macros = { version = "0.1.0", path = "../embassy-macros", features = ["nrf"]} 70embassy-macros = { version = "0.1.0", path = "../embassy-macros", features = ["nrf"]}
70embassy-hal-common = {version = "0.1.0", path = "../embassy-hal-common" } 71embassy-hal-common = {version = "0.1.0", path = "../embassy-hal-common" }
diff --git a/embassy-nrf/src/buffered_uarte.rs b/embassy-nrf/src/buffered_uarte.rs
index 89c1ba908..21ff1d73b 100644
--- a/embassy-nrf/src/buffered_uarte.rs
+++ b/embassy-nrf/src/buffered_uarte.rs
@@ -18,10 +18,10 @@ use core::future::Future;
18use core::sync::atomic::{compiler_fence, Ordering}; 18use core::sync::atomic::{compiler_fence, Ordering};
19use core::task::Poll; 19use core::task::Poll;
20 20
21use embassy::waitqueue::WakerRegistration;
22use embassy_cortex_m::peripheral::{PeripheralMutex, PeripheralState, StateStorage}; 21use embassy_cortex_m::peripheral::{PeripheralMutex, PeripheralState, StateStorage};
23use embassy_hal_common::ring_buffer::RingBuffer; 22use embassy_hal_common::ring_buffer::RingBuffer;
24use embassy_hal_common::{into_ref, low_power_wait_until, PeripheralRef}; 23use embassy_hal_common::{into_ref, PeripheralRef};
24use embassy_util::waitqueue::WakerRegistration;
25use futures::future::poll_fn; 25use futures::future::poll_fn;
26// Re-export SVD variants to allow user to directly set values 26// Re-export SVD variants to allow user to directly set values
27pub use pac::uarte0::{baudrate::BAUDRATE_A as Baudrate, config::PARITY_A as Parity}; 27pub use pac::uarte0::{baudrate::BAUDRATE_A as Baudrate, config::PARITY_A as Parity};
@@ -450,3 +450,13 @@ impl<'a, U: UarteInstance, T: TimerInstance> PeripheralState for StateInner<'a,
450 trace!("irq: end"); 450 trace!("irq: end");
451 } 451 }
452} 452}
453
454/// Low power blocking wait loop using WFE/SEV.
455fn low_power_wait_until(mut condition: impl FnMut() -> bool) {
456 while !condition() {
457 // WFE might "eat" an event that would have otherwise woken the executor.
458 cortex_m::asm::wfe();
459 }
460 // Retrigger an event to be transparent to the executor.
461 cortex_m::asm::sev();
462}
diff --git a/embassy-nrf/src/gpiote.rs b/embassy-nrf/src/gpiote.rs
index cef80ae0a..cf49b0db0 100644
--- a/embassy-nrf/src/gpiote.rs
+++ b/embassy-nrf/src/gpiote.rs
@@ -2,8 +2,8 @@ use core::convert::Infallible;
2use core::future::Future; 2use core::future::Future;
3use core::task::{Context, Poll}; 3use core::task::{Context, Poll};
4 4
5use embassy::waitqueue::AtomicWaker;
6use embassy_hal_common::{impl_peripheral, Peripheral, PeripheralRef}; 5use embassy_hal_common::{impl_peripheral, Peripheral, PeripheralRef};
6use embassy_util::waitqueue::AtomicWaker;
7use futures::future::poll_fn; 7use futures::future::poll_fn;
8 8
9use crate::gpio::sealed::Pin as _; 9use crate::gpio::sealed::Pin as _;
diff --git a/embassy-nrf/src/qdec.rs b/embassy-nrf/src/qdec.rs
index f6daec252..83f2916b9 100644
--- a/embassy-nrf/src/qdec.rs
+++ b/embassy-nrf/src/qdec.rs
@@ -2,8 +2,8 @@
2 2
3use core::task::Poll; 3use core::task::Poll;
4 4
5use embassy::waitqueue::AtomicWaker;
6use embassy_hal_common::{into_ref, PeripheralRef}; 5use embassy_hal_common::{into_ref, PeripheralRef};
6use embassy_util::waitqueue::AtomicWaker;
7use futures::future::poll_fn; 7use futures::future::poll_fn;
8 8
9use crate::gpio::sealed::Pin as _; 9use crate::gpio::sealed::Pin as _;
diff --git a/embassy-nrf/src/qspi.rs b/embassy-nrf/src/qspi.rs
index 67634b5b7..cedf88de5 100644
--- a/embassy-nrf/src/qspi.rs
+++ b/embassy-nrf/src/qspi.rs
@@ -512,7 +512,7 @@ cfg_if::cfg_if! {
512} 512}
513 513
514pub(crate) mod sealed { 514pub(crate) mod sealed {
515 use embassy::waitqueue::AtomicWaker; 515 use embassy_util::waitqueue::AtomicWaker;
516 516
517 use super::*; 517 use super::*;
518 518
diff --git a/embassy-nrf/src/rng.rs b/embassy-nrf/src/rng.rs
index 9bebd6fa3..7aad561b6 100644
--- a/embassy-nrf/src/rng.rs
+++ b/embassy-nrf/src/rng.rs
@@ -2,9 +2,9 @@ use core::ptr;
2use core::sync::atomic::{AtomicPtr, Ordering}; 2use core::sync::atomic::{AtomicPtr, Ordering};
3use core::task::Poll; 3use core::task::Poll;
4 4
5use embassy::waitqueue::AtomicWaker;
6use embassy_hal_common::drop::OnDrop; 5use embassy_hal_common::drop::OnDrop;
7use embassy_hal_common::{into_ref, PeripheralRef}; 6use embassy_hal_common::{into_ref, PeripheralRef};
7use embassy_util::waitqueue::AtomicWaker;
8use futures::future::poll_fn; 8use futures::future::poll_fn;
9 9
10use crate::interrupt::InterruptExt; 10use crate::interrupt::InterruptExt;
diff --git a/embassy-nrf/src/saadc.rs b/embassy-nrf/src/saadc.rs
index 6ddc70e52..f2ef46d8d 100644
--- a/embassy-nrf/src/saadc.rs
+++ b/embassy-nrf/src/saadc.rs
@@ -3,8 +3,8 @@
3use core::sync::atomic::{compiler_fence, Ordering}; 3use core::sync::atomic::{compiler_fence, Ordering};
4use core::task::Poll; 4use core::task::Poll;
5 5
6use embassy::waitqueue::AtomicWaker;
7use embassy_hal_common::{impl_peripheral, into_ref, PeripheralRef}; 6use embassy_hal_common::{impl_peripheral, into_ref, PeripheralRef};
7use embassy_util::waitqueue::AtomicWaker;
8use futures::future::poll_fn; 8use futures::future::poll_fn;
9use pac::{saadc, SAADC}; 9use pac::{saadc, SAADC};
10use saadc::ch::config::{GAIN_A, REFSEL_A, RESP_A, TACQ_A}; 10use saadc::ch::config::{GAIN_A, REFSEL_A, RESP_A, TACQ_A};
diff --git a/embassy-nrf/src/spim.rs b/embassy-nrf/src/spim.rs
index a512b4813..57c0c14c7 100644
--- a/embassy-nrf/src/spim.rs
+++ b/embassy-nrf/src/spim.rs
@@ -363,7 +363,7 @@ impl<'d, T: Instance> Drop for Spim<'d, T> {
363} 363}
364 364
365pub(crate) mod sealed { 365pub(crate) mod sealed {
366 use embassy::waitqueue::AtomicWaker; 366 use embassy_util::waitqueue::AtomicWaker;
367 367
368 use super::*; 368 use super::*;
369 369
diff --git a/embassy-nrf/src/temp.rs b/embassy-nrf/src/temp.rs
index a3b25ce05..1491e4268 100644
--- a/embassy-nrf/src/temp.rs
+++ b/embassy-nrf/src/temp.rs
@@ -2,9 +2,9 @@
2 2
3use core::task::Poll; 3use core::task::Poll;
4 4
5use embassy::waitqueue::AtomicWaker;
6use embassy_hal_common::drop::OnDrop; 5use embassy_hal_common::drop::OnDrop;
7use embassy_hal_common::{into_ref, PeripheralRef}; 6use embassy_hal_common::{into_ref, PeripheralRef};
7use embassy_util::waitqueue::AtomicWaker;
8use fixed::types::I30F2; 8use fixed::types::I30F2;
9use futures::future::poll_fn; 9use futures::future::poll_fn;
10 10
diff --git a/embassy-nrf/src/time_driver.rs b/embassy-nrf/src/time_driver.rs
index f7b3345b2..05fa0aea8 100644
--- a/embassy-nrf/src/time_driver.rs
+++ b/embassy-nrf/src/time_driver.rs
@@ -3,9 +3,9 @@ use core::sync::atomic::{compiler_fence, AtomicU32, AtomicU8, Ordering};
3use core::{mem, ptr}; 3use core::{mem, ptr};
4 4
5use critical_section::CriticalSection; 5use critical_section::CriticalSection;
6use embassy::blocking_mutex::raw::CriticalSectionRawMutex; 6use embassy_executor::time::driver::{AlarmHandle, Driver};
7use embassy::blocking_mutex::CriticalSectionMutex as Mutex; 7use embassy_util::blocking_mutex::raw::CriticalSectionRawMutex;
8use embassy::time::driver::{AlarmHandle, Driver}; 8use embassy_util::blocking_mutex::CriticalSectionMutex as Mutex;
9 9
10use crate::interrupt::{Interrupt, InterruptExt}; 10use crate::interrupt::{Interrupt, InterruptExt};
11use crate::{interrupt, pac}; 11use crate::{interrupt, pac};
@@ -119,7 +119,7 @@ struct RtcDriver {
119} 119}
120 120
121const ALARM_STATE_NEW: AlarmState = AlarmState::new(); 121const ALARM_STATE_NEW: AlarmState = AlarmState::new();
122embassy::time_driver_impl!(static DRIVER: RtcDriver = RtcDriver { 122embassy_executor::time_driver_impl!(static DRIVER: RtcDriver = RtcDriver {
123 period: AtomicU32::new(0), 123 period: AtomicU32::new(0),
124 alarm_count: AtomicU8::new(0), 124 alarm_count: AtomicU8::new(0),
125 alarms: Mutex::const_new(CriticalSectionRawMutex::new(), [ALARM_STATE_NEW; ALARM_COUNT]), 125 alarms: Mutex::const_new(CriticalSectionRawMutex::new(), [ALARM_STATE_NEW; ALARM_COUNT]),
diff --git a/embassy-nrf/src/timer.rs b/embassy-nrf/src/timer.rs
index 8deecdc03..b3b613db2 100644
--- a/embassy-nrf/src/timer.rs
+++ b/embassy-nrf/src/timer.rs
@@ -3,9 +3,9 @@
3use core::marker::PhantomData; 3use core::marker::PhantomData;
4use core::task::Poll; 4use core::task::Poll;
5 5
6use embassy::waitqueue::AtomicWaker;
7use embassy_hal_common::drop::OnDrop; 6use embassy_hal_common::drop::OnDrop;
8use embassy_hal_common::{into_ref, PeripheralRef}; 7use embassy_hal_common::{into_ref, PeripheralRef};
8use embassy_util::waitqueue::AtomicWaker;
9use futures::future::poll_fn; 9use futures::future::poll_fn;
10 10
11use crate::interrupt::{Interrupt, InterruptExt}; 11use crate::interrupt::{Interrupt, InterruptExt};
@@ -40,8 +40,8 @@ macro_rules! impl_timer {
40 fn regs() -> &'static pac::timer0::RegisterBlock { 40 fn regs() -> &'static pac::timer0::RegisterBlock {
41 unsafe { &*(pac::$pac_type::ptr() as *const pac::timer0::RegisterBlock) } 41 unsafe { &*(pac::$pac_type::ptr() as *const pac::timer0::RegisterBlock) }
42 } 42 }
43 fn waker(n: usize) -> &'static ::embassy::waitqueue::AtomicWaker { 43 fn waker(n: usize) -> &'static ::embassy_util::waitqueue::AtomicWaker {
44 use ::embassy::waitqueue::AtomicWaker; 44 use ::embassy_util::waitqueue::AtomicWaker;
45 const NEW_AW: AtomicWaker = AtomicWaker::new(); 45 const NEW_AW: AtomicWaker = AtomicWaker::new();
46 static WAKERS: [AtomicWaker; $ccs] = [NEW_AW; $ccs]; 46 static WAKERS: [AtomicWaker; $ccs] = [NEW_AW; $ccs];
47 &WAKERS[n] 47 &WAKERS[n]
diff --git a/embassy-nrf/src/twim.rs b/embassy-nrf/src/twim.rs
index 6d6eb84e7..494abe0cc 100644
--- a/embassy-nrf/src/twim.rs
+++ b/embassy-nrf/src/twim.rs
@@ -11,11 +11,11 @@ use core::sync::atomic::compiler_fence;
11use core::sync::atomic::Ordering::SeqCst; 11use core::sync::atomic::Ordering::SeqCst;
12use core::task::Poll; 12use core::task::Poll;
13 13
14#[cfg(feature = "time")]
15use embassy::time::{Duration, Instant};
16use embassy::waitqueue::AtomicWaker;
17use embassy_embedded_hal::SetConfig; 14use embassy_embedded_hal::SetConfig;
15#[cfg(feature = "time")]
16use embassy_executor::time::{Duration, Instant};
18use embassy_hal_common::{into_ref, PeripheralRef}; 17use embassy_hal_common::{into_ref, PeripheralRef};
18use embassy_util::waitqueue::AtomicWaker;
19use futures::future::poll_fn; 19use futures::future::poll_fn;
20 20
21use crate::chip::{EASY_DMA_SIZE, FORCE_COPY_BUFFER_SIZE}; 21use crate::chip::{EASY_DMA_SIZE, FORCE_COPY_BUFFER_SIZE};
diff --git a/embassy-nrf/src/uarte.rs b/embassy-nrf/src/uarte.rs
index 792b8ecca..0d24cf65f 100644
--- a/embassy-nrf/src/uarte.rs
+++ b/embassy-nrf/src/uarte.rs
@@ -932,7 +932,7 @@ impl<'d, U: Instance, T: TimerInstance> UarteRxWithIdle<'d, U, T> {
932pub(crate) mod sealed { 932pub(crate) mod sealed {
933 use core::sync::atomic::AtomicU8; 933 use core::sync::atomic::AtomicU8;
934 934
935 use embassy::waitqueue::AtomicWaker; 935 use embassy_util::waitqueue::AtomicWaker;
936 936
937 use super::*; 937 use super::*;
938 938
diff --git a/embassy-nrf/src/usb.rs b/embassy-nrf/src/usb.rs
index 378492859..ee99a9a6a 100644
--- a/embassy-nrf/src/usb.rs
+++ b/embassy-nrf/src/usb.rs
@@ -6,11 +6,11 @@ use core::sync::atomic::{compiler_fence, AtomicBool, AtomicU32, Ordering};
6use core::task::Poll; 6use core::task::Poll;
7 7
8use cortex_m::peripheral::NVIC; 8use cortex_m::peripheral::NVIC;
9use embassy::waitqueue::AtomicWaker;
10use embassy_hal_common::{into_ref, PeripheralRef}; 9use embassy_hal_common::{into_ref, PeripheralRef};
11pub use embassy_usb; 10pub use embassy_usb;
12use embassy_usb::driver::{self, EndpointError, Event, Unsupported}; 11use embassy_usb::driver::{self, EndpointError, Event, Unsupported};
13use embassy_usb::types::{EndpointAddress, EndpointInfo, EndpointType, UsbDirection}; 12use embassy_usb::types::{EndpointAddress, EndpointInfo, EndpointType, UsbDirection};
13use embassy_util::waitqueue::AtomicWaker;
14use futures::future::poll_fn; 14use futures::future::poll_fn;
15use futures::Future; 15use futures::Future;
16use pac::usbd::RegisterBlock; 16use pac::usbd::RegisterBlock;
diff --git a/embassy-rp/Cargo.toml b/embassy-rp/Cargo.toml
index 6529e1a37..303617ffc 100644
--- a/embassy-rp/Cargo.toml
+++ b/embassy-rp/Cargo.toml
@@ -20,14 +20,15 @@ flavors = [
20unstable-pac = [] 20unstable-pac = []
21 21
22# Enable nightly-only features 22# Enable nightly-only features
23nightly = ["embassy/nightly", "embedded-hal-1", "embedded-hal-async", "embassy-embedded-hal/nightly"] 23nightly = ["embassy-executor/nightly", "embedded-hal-1", "embedded-hal-async", "embassy-embedded-hal/nightly"]
24 24
25# Implement embedded-hal 1.0 alpha traits. 25# Implement embedded-hal 1.0 alpha traits.
26# Implement embedded-hal-async traits if `nightly` is set as well. 26# Implement embedded-hal-async traits if `nightly` is set as well.
27unstable-traits = ["embedded-hal-1"] 27unstable-traits = ["embedded-hal-1"]
28 28
29[dependencies] 29[dependencies]
30embassy = { version = "0.1.0", path = "../embassy", features = [ "time-tick-1mhz" ] } 30embassy-util = { version = "0.1.0", path = "../embassy-util" }
31embassy-executor = { version = "0.1.0", path = "../embassy-executor", features = [ "time-tick-1mhz" ] }
31embassy-cortex-m = { version = "0.1.0", path = "../embassy-cortex-m", features = ["prio-bits-3"]} 32embassy-cortex-m = { version = "0.1.0", path = "../embassy-cortex-m", features = ["prio-bits-3"]}
32embassy-hal-common = {version = "0.1.0", path = "../embassy-hal-common" } 33embassy-hal-common = {version = "0.1.0", path = "../embassy-hal-common" }
33embassy-embedded-hal = {version = "0.1.0", path = "../embassy-embedded-hal" } 34embassy-embedded-hal = {version = "0.1.0", path = "../embassy-embedded-hal" }
diff --git a/embassy-rp/src/gpio.rs b/embassy-rp/src/gpio.rs
index 5db1a690b..9779f1378 100644
--- a/embassy-rp/src/gpio.rs
+++ b/embassy-rp/src/gpio.rs
@@ -3,9 +3,9 @@ use core::future::Future;
3use core::pin::Pin as FuturePin; 3use core::pin::Pin as FuturePin;
4use core::task::{Context, Poll}; 4use core::task::{Context, Poll};
5 5
6use embassy::waitqueue::AtomicWaker;
7use embassy_cortex_m::interrupt::{Interrupt, InterruptExt}; 6use embassy_cortex_m::interrupt::{Interrupt, InterruptExt};
8use embassy_hal_common::{impl_peripheral, into_ref, PeripheralRef}; 7use embassy_hal_common::{impl_peripheral, into_ref, PeripheralRef};
8use embassy_util::waitqueue::AtomicWaker;
9 9
10use crate::pac::common::{Reg, RW}; 10use crate::pac::common::{Reg, RW};
11use crate::pac::SIO; 11use crate::pac::SIO;
diff --git a/embassy-rp/src/timer.rs b/embassy-rp/src/timer.rs
index 6c4c258b1..142fd410d 100644
--- a/embassy-rp/src/timer.rs
+++ b/embassy-rp/src/timer.rs
@@ -2,9 +2,9 @@ use core::cell::Cell;
2 2
3use atomic_polyfill::{AtomicU8, Ordering}; 3use atomic_polyfill::{AtomicU8, Ordering};
4use critical_section::CriticalSection; 4use critical_section::CriticalSection;
5use embassy::blocking_mutex::raw::CriticalSectionRawMutex; 5use embassy_executor::time::driver::{AlarmHandle, Driver};
6use embassy::blocking_mutex::Mutex; 6use embassy_util::blocking_mutex::raw::CriticalSectionRawMutex;
7use embassy::time::driver::{AlarmHandle, Driver}; 7use embassy_util::blocking_mutex::Mutex;
8 8
9use crate::interrupt::{Interrupt, InterruptExt}; 9use crate::interrupt::{Interrupt, InterruptExt};
10use crate::{interrupt, pac}; 10use crate::{interrupt, pac};
@@ -26,7 +26,7 @@ struct TimerDriver {
26 next_alarm: AtomicU8, 26 next_alarm: AtomicU8,
27} 27}
28 28
29embassy::time_driver_impl!(static DRIVER: TimerDriver = TimerDriver{ 29embassy_executor::time_driver_impl!(static DRIVER: TimerDriver = TimerDriver{
30 alarms: Mutex::const_new(CriticalSectionRawMutex::new(), [DUMMY_ALARM; ALARM_COUNT]), 30 alarms: Mutex::const_new(CriticalSectionRawMutex::new(), [DUMMY_ALARM; ALARM_COUNT]),
31 next_alarm: AtomicU8::new(0), 31 next_alarm: AtomicU8::new(0),
32}); 32});
diff --git a/embassy-stm32/Cargo.toml b/embassy-stm32/Cargo.toml
index e9c3fdf45..ff228cc85 100644
--- a/embassy-stm32/Cargo.toml
+++ b/embassy-stm32/Cargo.toml
@@ -10,7 +10,7 @@ src_base_git = "https://github.com/embassy-rs/embassy/blob/$COMMIT/embassy-stm32
10# TODO: sdmmc 10# TODO: sdmmc
11# TODO: net 11# TODO: net
12# TODO: subghz 12# TODO: subghz
13features = ["nightly", "defmt", "unstable-pac", "unstable-traits", "exti", "time-driver-any", "embassy/time-tick-32768hz"] 13features = ["nightly", "defmt", "unstable-pac", "unstable-traits", "exti", "time-driver-any", "embassy-executor/time-tick-32768hz"]
14flavors = [ 14flavors = [
15 { regex_feature = "stm32f0.*", target = "thumbv6m-none-eabi" }, 15 { regex_feature = "stm32f0.*", target = "thumbv6m-none-eabi" },
16 { regex_feature = "stm32f1.*", target = "thumbv7m-none-eabi" }, 16 { regex_feature = "stm32f1.*", target = "thumbv7m-none-eabi" },
@@ -31,7 +31,8 @@ flavors = [
31] 31]
32 32
33[dependencies] 33[dependencies]
34embassy = { version = "0.1.0", path = "../embassy" } 34embassy-util = { version = "0.1.0", path = "../embassy-util" }
35embassy-executor = { version = "0.1.0", path = "../embassy-executor" }
35embassy-cortex-m = { version = "0.1.0", path = "../embassy-cortex-m", features = ["prio-bits-4"]} 36embassy-cortex-m = { version = "0.1.0", path = "../embassy-cortex-m", features = ["prio-bits-4"]}
36embassy-macros = { version = "0.1.0", path = "../embassy-macros", features = ["stm32"] } 37embassy-macros = { version = "0.1.0", path = "../embassy-macros", features = ["stm32"] }
37embassy-hal-common = {version = "0.1.0", path = "../embassy-hal-common" } 38embassy-hal-common = {version = "0.1.0", path = "../embassy-hal-common" }
@@ -72,7 +73,7 @@ quote = "1.0.15"
72stm32-metapac = { version = "0.1.0", path = "../stm32-metapac", default-features = false, features = ["metadata"]} 73stm32-metapac = { version = "0.1.0", path = "../stm32-metapac", default-features = false, features = ["metadata"]}
73 74
74[features] 75[features]
75defmt = ["dep:defmt", "bxcan/unstable-defmt", "embassy/defmt", "embassy-embedded-hal/defmt", "embedded-io?/defmt", "embassy-usb?/defmt"] 76defmt = ["dep:defmt", "bxcan/unstable-defmt", "embassy-util/defmt", "embassy-executor/defmt", "embassy-embedded-hal/defmt", "embedded-io?/defmt", "embassy-usb?/defmt"]
76sdmmc-rs = ["embedded-sdmmc"] 77sdmmc-rs = ["embedded-sdmmc"]
77net = ["embassy-net" ] 78net = ["embassy-net" ]
78memory-x = ["stm32-metapac/memory-x"] 79memory-x = ["stm32-metapac/memory-x"]
@@ -81,7 +82,7 @@ exti = []
81 82
82# Features starting with `_` are for internal use only. They're not intended 83# Features starting with `_` are for internal use only. They're not intended
83# to be enabled by other crates, and are not covered by semver guarantees. 84# to be enabled by other crates, and are not covered by semver guarantees.
84_time-driver = ["embassy/time"] 85_time-driver = ["embassy-executor/time"]
85time-driver-any = ["_time-driver"] 86time-driver-any = ["_time-driver"]
86time-driver-tim2 = ["_time-driver"] 87time-driver-tim2 = ["_time-driver"]
87time-driver-tim3 = ["_time-driver"] 88time-driver-tim3 = ["_time-driver"]
@@ -91,7 +92,7 @@ time-driver-tim12 = ["_time-driver"]
91time-driver-tim15 = ["_time-driver"] 92time-driver-tim15 = ["_time-driver"]
92 93
93# Enable nightly-only features 94# Enable nightly-only features
94nightly = ["embassy/nightly", "embedded-hal-1", "embedded-hal-async", "embedded-storage-async", "dep:embedded-io", "dep:embassy-usb", "embassy-embedded-hal/nightly"] 95nightly = ["embassy-executor/nightly", "embedded-hal-1", "embedded-hal-async", "embedded-storage-async", "dep:embedded-io", "dep:embassy-usb", "embassy-embedded-hal/nightly"]
95 96
96# Reexport stm32-metapac at `embassy_stm32::pac`. 97# Reexport stm32-metapac at `embassy_stm32::pac`.
97# This is unstable because semver-minor (non-breaking) releases of embassy-stm32 may major-bump (breaking) the stm32-metapac version. 98# This is unstable because semver-minor (non-breaking) releases of embassy-stm32 may major-bump (breaking) the stm32-metapac version.
diff --git a/embassy-stm32/src/dcmi.rs b/embassy-stm32/src/dcmi.rs
index e28225426..bbb9a12cb 100644
--- a/embassy-stm32/src/dcmi.rs
+++ b/embassy-stm32/src/dcmi.rs
@@ -1,7 +1,7 @@
1use core::task::Poll; 1use core::task::Poll;
2 2
3use embassy::waitqueue::AtomicWaker;
4use embassy_hal_common::{into_ref, PeripheralRef}; 3use embassy_hal_common::{into_ref, PeripheralRef};
4use embassy_util::waitqueue::AtomicWaker;
5use futures::future::poll_fn; 5use futures::future::poll_fn;
6 6
7use crate::gpio::sealed::AFType; 7use crate::gpio::sealed::AFType;
diff --git a/embassy-stm32/src/dma/bdma.rs b/embassy-stm32/src/dma/bdma.rs
index c87f3ac49..bd2cd5b57 100644
--- a/embassy-stm32/src/dma/bdma.rs
+++ b/embassy-stm32/src/dma/bdma.rs
@@ -3,7 +3,7 @@
3use core::sync::atomic::{fence, Ordering}; 3use core::sync::atomic::{fence, Ordering};
4use core::task::Waker; 4use core::task::Waker;
5 5
6use embassy::waitqueue::AtomicWaker; 6use embassy_util::waitqueue::AtomicWaker;
7 7
8use super::{TransferOptions, Word, WordSize}; 8use super::{TransferOptions, Word, WordSize};
9use crate::_generated::BDMA_CHANNEL_COUNT; 9use crate::_generated::BDMA_CHANNEL_COUNT;
diff --git a/embassy-stm32/src/dma/dma.rs b/embassy-stm32/src/dma/dma.rs
index e8e589de8..0c66005c7 100644
--- a/embassy-stm32/src/dma/dma.rs
+++ b/embassy-stm32/src/dma/dma.rs
@@ -1,7 +1,7 @@
1use core::sync::atomic::{fence, Ordering}; 1use core::sync::atomic::{fence, Ordering};
2use core::task::Waker; 2use core::task::Waker;
3 3
4use embassy::waitqueue::AtomicWaker; 4use embassy_util::waitqueue::AtomicWaker;
5 5
6use super::{Burst, FlowControl, Request, TransferOptions, Word, WordSize}; 6use super::{Burst, FlowControl, Request, TransferOptions, Word, WordSize};
7use crate::_generated::DMA_CHANNEL_COUNT; 7use crate::_generated::DMA_CHANNEL_COUNT;
diff --git a/embassy-stm32/src/dma/gpdma.rs b/embassy-stm32/src/dma/gpdma.rs
index 8e901d725..1aea6c65d 100644
--- a/embassy-stm32/src/dma/gpdma.rs
+++ b/embassy-stm32/src/dma/gpdma.rs
@@ -1,7 +1,7 @@
1use core::sync::atomic::{fence, Ordering}; 1use core::sync::atomic::{fence, Ordering};
2use core::task::Waker; 2use core::task::Waker;
3 3
4use embassy::waitqueue::AtomicWaker; 4use embassy_util::waitqueue::AtomicWaker;
5 5
6use super::{Request, TransferOptions, Word, WordSize}; 6use super::{Request, TransferOptions, Word, WordSize};
7use crate::_generated::GPDMA_CHANNEL_COUNT; 7use crate::_generated::GPDMA_CHANNEL_COUNT;
diff --git a/embassy-stm32/src/eth/v1/mod.rs b/embassy-stm32/src/eth/v1/mod.rs
index 5e31c32b5..37593914f 100644
--- a/embassy-stm32/src/eth/v1/mod.rs
+++ b/embassy-stm32/src/eth/v1/mod.rs
@@ -4,10 +4,10 @@ use core::marker::PhantomData;
4use core::sync::atomic::{fence, Ordering}; 4use core::sync::atomic::{fence, Ordering};
5use core::task::Waker; 5use core::task::Waker;
6 6
7use embassy::waitqueue::AtomicWaker;
8use embassy_cortex_m::peripheral::{PeripheralMutex, PeripheralState, StateStorage}; 7use embassy_cortex_m::peripheral::{PeripheralMutex, PeripheralState, StateStorage};
9use embassy_hal_common::{into_ref, PeripheralRef}; 8use embassy_hal_common::{into_ref, PeripheralRef};
10use embassy_net::{Device, DeviceCapabilities, LinkState, PacketBuf, MTU}; 9use embassy_net::{Device, DeviceCapabilities, LinkState, PacketBuf, MTU};
10use embassy_util::waitqueue::AtomicWaker;
11 11
12use crate::gpio::sealed::{AFType, Pin as __GpioPin}; 12use crate::gpio::sealed::{AFType, Pin as __GpioPin};
13use crate::gpio::{AnyPin, Speed}; 13use crate::gpio::{AnyPin, Speed};
diff --git a/embassy-stm32/src/eth/v2/mod.rs b/embassy-stm32/src/eth/v2/mod.rs
index 2b4a9367b..1bc1fb72e 100644
--- a/embassy-stm32/src/eth/v2/mod.rs
+++ b/embassy-stm32/src/eth/v2/mod.rs
@@ -2,10 +2,10 @@ use core::marker::PhantomData;
2use core::sync::atomic::{fence, Ordering}; 2use core::sync::atomic::{fence, Ordering};
3use core::task::Waker; 3use core::task::Waker;
4 4
5use embassy::waitqueue::AtomicWaker;
6use embassy_cortex_m::peripheral::{PeripheralMutex, PeripheralState, StateStorage}; 5use embassy_cortex_m::peripheral::{PeripheralMutex, PeripheralState, StateStorage};
7use embassy_hal_common::{into_ref, PeripheralRef}; 6use embassy_hal_common::{into_ref, PeripheralRef};
8use embassy_net::{Device, DeviceCapabilities, LinkState, PacketBuf, MTU}; 7use embassy_net::{Device, DeviceCapabilities, LinkState, PacketBuf, MTU};
8use embassy_util::waitqueue::AtomicWaker;
9 9
10use crate::gpio::sealed::{AFType, Pin as _}; 10use crate::gpio::sealed::{AFType, Pin as _};
11use crate::gpio::{AnyPin, Speed}; 11use crate::gpio::{AnyPin, Speed};
diff --git a/embassy-stm32/src/exti.rs b/embassy-stm32/src/exti.rs
index 3b8d9390f..ecb180bbe 100644
--- a/embassy-stm32/src/exti.rs
+++ b/embassy-stm32/src/exti.rs
@@ -3,8 +3,8 @@ use core::marker::PhantomData;
3use core::pin::Pin; 3use core::pin::Pin;
4use core::task::{Context, Poll}; 4use core::task::{Context, Poll};
5 5
6use embassy::waitqueue::AtomicWaker;
7use embassy_hal_common::impl_peripheral; 6use embassy_hal_common::impl_peripheral;
7use embassy_util::waitqueue::AtomicWaker;
8 8
9use crate::gpio::{AnyPin, Input, Pin as GpioPin}; 9use crate::gpio::{AnyPin, Input, Pin as GpioPin};
10use crate::pac::exti::regs::Lines; 10use crate::pac::exti::regs::Lines;
diff --git a/embassy-stm32/src/i2c/v2.rs b/embassy-stm32/src/i2c/v2.rs
index dec92cc88..f8067e8b3 100644
--- a/embassy-stm32/src/i2c/v2.rs
+++ b/embassy-stm32/src/i2c/v2.rs
@@ -2,10 +2,10 @@ use core::cmp;
2use core::task::Poll; 2use core::task::Poll;
3 3
4use atomic_polyfill::{AtomicUsize, Ordering}; 4use atomic_polyfill::{AtomicUsize, Ordering};
5use embassy::waitqueue::AtomicWaker;
6use embassy_embedded_hal::SetConfig; 5use embassy_embedded_hal::SetConfig;
7use embassy_hal_common::drop::OnDrop; 6use embassy_hal_common::drop::OnDrop;
8use embassy_hal_common::{into_ref, PeripheralRef}; 7use embassy_hal_common::{into_ref, PeripheralRef};
8use embassy_util::waitqueue::AtomicWaker;
9use futures::future::poll_fn; 9use futures::future::poll_fn;
10 10
11use crate::dma::NoDma; 11use crate::dma::NoDma;
diff --git a/embassy-stm32/src/rng.rs b/embassy-stm32/src/rng.rs
index 2b0ee7131..81e28f355 100644
--- a/embassy-stm32/src/rng.rs
+++ b/embassy-stm32/src/rng.rs
@@ -2,8 +2,8 @@
2 2
3use core::task::Poll; 3use core::task::Poll;
4 4
5use embassy::waitqueue::AtomicWaker;
6use embassy_hal_common::{into_ref, PeripheralRef}; 5use embassy_hal_common::{into_ref, PeripheralRef};
6use embassy_util::waitqueue::AtomicWaker;
7use futures::future::poll_fn; 7use futures::future::poll_fn;
8use rand_core::{CryptoRng, RngCore}; 8use rand_core::{CryptoRng, RngCore};
9 9
diff --git a/embassy-stm32/src/sdmmc/mod.rs b/embassy-stm32/src/sdmmc/mod.rs
index b9dff8faf..1de4b2aa6 100644
--- a/embassy-stm32/src/sdmmc/mod.rs
+++ b/embassy-stm32/src/sdmmc/mod.rs
@@ -3,9 +3,9 @@
3use core::default::Default; 3use core::default::Default;
4use core::task::Poll; 4use core::task::Poll;
5 5
6use embassy::waitqueue::AtomicWaker;
7use embassy_hal_common::drop::OnDrop; 6use embassy_hal_common::drop::OnDrop;
8use embassy_hal_common::{into_ref, PeripheralRef}; 7use embassy_hal_common::{into_ref, PeripheralRef};
8use embassy_util::waitqueue::AtomicWaker;
9use futures::future::poll_fn; 9use futures::future::poll_fn;
10use sdio_host::{BusWidth, CardCapacity, CardStatus, CurrentState, SDStatus, CID, CSD, OCR, SCR}; 10use sdio_host::{BusWidth, CardCapacity, CardStatus, CurrentState, SDStatus, CID, CSD, OCR, SCR};
11 11
@@ -1507,8 +1507,8 @@ foreach_peripheral!(
1507 INNER 1507 INNER
1508 } 1508 }
1509 1509
1510 fn state() -> &'static ::embassy::waitqueue::AtomicWaker { 1510 fn state() -> &'static ::embassy_util::waitqueue::AtomicWaker {
1511 static WAKER: ::embassy::waitqueue::AtomicWaker = ::embassy::waitqueue::AtomicWaker::new(); 1511 static WAKER: ::embassy_util::waitqueue::AtomicWaker = ::embassy_util::waitqueue::AtomicWaker::new();
1512 &WAKER 1512 &WAKER
1513 } 1513 }
1514 } 1514 }
diff --git a/embassy-stm32/src/subghz/mod.rs b/embassy-stm32/src/subghz/mod.rs
index f02fc140f..4e53efed5 100644
--- a/embassy-stm32/src/subghz/mod.rs
+++ b/embassy-stm32/src/subghz/mod.rs
@@ -504,7 +504,7 @@ impl<'d> SubGhz<'d, NoDma, NoDma> {
504 /// 504 ///
505 /// sg.set_standby(StandbyClk::Rc)?; 505 /// sg.set_standby(StandbyClk::Rc)?;
506 /// unsafe { sg.set_sleep(SleepCfg::default())? }; 506 /// unsafe { sg.set_sleep(SleepCfg::default())? };
507 /// embassy::time::Timer::after(embassy::time::Duration::from_micros(500)).await; 507 /// embassy_executor::time::Timer::after(embassy_executor::time::Duration::from_micros(500)).await;
508 /// unsafe { wakeup() }; 508 /// unsafe { wakeup() };
509 /// # Ok::<(), embassy_stm32::subghz::Error>(()) 509 /// # Ok::<(), embassy_stm32::subghz::Error>(())
510 /// ``` 510 /// ```
diff --git a/embassy-stm32/src/subghz/timeout.rs b/embassy-stm32/src/subghz/timeout.rs
index 9dbdc6374..b8d6ad8f9 100644
--- a/embassy-stm32/src/subghz/timeout.rs
+++ b/embassy-stm32/src/subghz/timeout.rs
@@ -439,9 +439,9 @@ impl From<Timeout> for [u8; 3] {
439 } 439 }
440} 440}
441 441
442impl From<Timeout> for embassy::time::Duration { 442impl From<Timeout> for embassy_executor::time::Duration {
443 fn from(to: Timeout) -> Self { 443 fn from(to: Timeout) -> Self {
444 embassy::time::Duration::from_micros(to.as_micros().into()) 444 embassy_executor::time::Duration::from_micros(to.as_micros().into())
445 } 445 }
446} 446}
447 447
diff --git a/embassy-stm32/src/subghz/tx_params.rs b/embassy-stm32/src/subghz/tx_params.rs
index 5194a8379..a72c060f3 100644
--- a/embassy-stm32/src/subghz/tx_params.rs
+++ b/embassy-stm32/src/subghz/tx_params.rs
@@ -44,17 +44,17 @@ impl From<RampTime> for core::time::Duration {
44 } 44 }
45} 45}
46 46
47impl From<RampTime> for embassy::time::Duration { 47impl From<RampTime> for embassy_executor::time::Duration {
48 fn from(rt: RampTime) -> Self { 48 fn from(rt: RampTime) -> Self {
49 match rt { 49 match rt {
50 RampTime::Micros10 => embassy::time::Duration::from_micros(10), 50 RampTime::Micros10 => embassy_executor::time::Duration::from_micros(10),
51 RampTime::Micros20 => embassy::time::Duration::from_micros(20), 51 RampTime::Micros20 => embassy_executor::time::Duration::from_micros(20),
52 RampTime::Micros40 => embassy::time::Duration::from_micros(40), 52 RampTime::Micros40 => embassy_executor::time::Duration::from_micros(40),
53 RampTime::Micros80 => embassy::time::Duration::from_micros(80), 53 RampTime::Micros80 => embassy_executor::time::Duration::from_micros(80),
54 RampTime::Micros200 => embassy::time::Duration::from_micros(200), 54 RampTime::Micros200 => embassy_executor::time::Duration::from_micros(200),
55 RampTime::Micros800 => embassy::time::Duration::from_micros(800), 55 RampTime::Micros800 => embassy_executor::time::Duration::from_micros(800),
56 RampTime::Micros1700 => embassy::time::Duration::from_micros(1700), 56 RampTime::Micros1700 => embassy_executor::time::Duration::from_micros(1700),
57 RampTime::Micros3400 => embassy::time::Duration::from_micros(3400), 57 RampTime::Micros3400 => embassy_executor::time::Duration::from_micros(3400),
58 } 58 }
59 } 59 }
60} 60}
diff --git a/embassy-stm32/src/time_driver.rs b/embassy-stm32/src/time_driver.rs
index 38a4adc1d..6cea43f18 100644
--- a/embassy-stm32/src/time_driver.rs
+++ b/embassy-stm32/src/time_driver.rs
@@ -4,10 +4,10 @@ use core::sync::atomic::{compiler_fence, Ordering};
4use core::{mem, ptr}; 4use core::{mem, ptr};
5 5
6use atomic_polyfill::{AtomicU32, AtomicU8}; 6use atomic_polyfill::{AtomicU32, AtomicU8};
7use embassy::blocking_mutex::raw::CriticalSectionRawMutex; 7use embassy_executor::time::driver::{AlarmHandle, Driver};
8use embassy::blocking_mutex::Mutex; 8use embassy_executor::time::TICKS_PER_SECOND;
9use embassy::time::driver::{AlarmHandle, Driver}; 9use embassy_util::blocking_mutex::raw::CriticalSectionRawMutex;
10use embassy::time::TICKS_PER_SECOND; 10use embassy_util::blocking_mutex::Mutex;
11use stm32_metapac::timer::regs; 11use stm32_metapac::timer::regs;
12 12
13use crate::interrupt::{CriticalSection, InterruptExt}; 13use crate::interrupt::{CriticalSection, InterruptExt};
@@ -133,7 +133,7 @@ struct RtcDriver {
133 133
134const ALARM_STATE_NEW: AlarmState = AlarmState::new(); 134const ALARM_STATE_NEW: AlarmState = AlarmState::new();
135 135
136embassy::time_driver_impl!(static DRIVER: RtcDriver = RtcDriver { 136embassy_executor::time_driver_impl!(static DRIVER: RtcDriver = RtcDriver {
137 period: AtomicU32::new(0), 137 period: AtomicU32::new(0),
138 alarm_count: AtomicU8::new(0), 138 alarm_count: AtomicU8::new(0),
139 alarms: Mutex::const_new(CriticalSectionRawMutex::new(), [ALARM_STATE_NEW; ALARM_COUNT]), 139 alarms: Mutex::const_new(CriticalSectionRawMutex::new(), [ALARM_STATE_NEW; ALARM_COUNT]),
diff --git a/embassy-stm32/src/usart/buffered.rs b/embassy-stm32/src/usart/buffered.rs
index 4e47ef73d..0e8d0d682 100644
--- a/embassy-stm32/src/usart/buffered.rs
+++ b/embassy-stm32/src/usart/buffered.rs
@@ -2,9 +2,9 @@ use core::future::Future;
2use core::task::Poll; 2use core::task::Poll;
3 3
4use atomic_polyfill::{compiler_fence, Ordering}; 4use atomic_polyfill::{compiler_fence, Ordering};
5use embassy::waitqueue::WakerRegistration;
6use embassy_cortex_m::peripheral::{PeripheralMutex, PeripheralState, StateStorage}; 5use embassy_cortex_m::peripheral::{PeripheralMutex, PeripheralState, StateStorage};
7use embassy_hal_common::ring_buffer::RingBuffer; 6use embassy_hal_common::ring_buffer::RingBuffer;
7use embassy_util::waitqueue::WakerRegistration;
8use futures::future::poll_fn; 8use futures::future::poll_fn;
9 9
10use super::*; 10use super::*;
diff --git a/embassy-stm32/src/usb/usb.rs b/embassy-stm32/src/usb/usb.rs
index 11ef75954..764b21461 100644
--- a/embassy-stm32/src/usb/usb.rs
+++ b/embassy-stm32/src/usb/usb.rs
@@ -5,11 +5,11 @@ use core::sync::atomic::Ordering;
5use core::task::Poll; 5use core::task::Poll;
6 6
7use atomic_polyfill::{AtomicBool, AtomicU8}; 7use atomic_polyfill::{AtomicBool, AtomicU8};
8use embassy::time::{block_for, Duration}; 8use embassy_executor::time::{block_for, Duration};
9use embassy::waitqueue::AtomicWaker;
10use embassy_hal_common::into_ref; 9use embassy_hal_common::into_ref;
11use embassy_usb::driver::{self, EndpointAllocError, EndpointError, Event, Unsupported}; 10use embassy_usb::driver::{self, EndpointAllocError, EndpointError, Event, Unsupported};
12use embassy_usb::types::{EndpointAddress, EndpointInfo, EndpointType, UsbDirection}; 11use embassy_usb::types::{EndpointAddress, EndpointInfo, EndpointType, UsbDirection};
12use embassy_util::waitqueue::AtomicWaker;
13use futures::future::poll_fn; 13use futures::future::poll_fn;
14use futures::Future; 14use futures::Future;
15use pac::common::{Reg, RW}; 15use pac::common::{Reg, RW};
diff --git a/embassy-usb-hid/Cargo.toml b/embassy-usb-hid/Cargo.toml
index b8185fa5a..53b6db3da 100644
--- a/embassy-usb-hid/Cargo.toml
+++ b/embassy-usb-hid/Cargo.toml
@@ -6,7 +6,7 @@ edition = "2021"
6[package.metadata.embassy_docs] 6[package.metadata.embassy_docs]
7src_base = "https://github.com/embassy-rs/embassy/blob/embassy-usb-hid-v$VERSION/embassy-usb-hid/src/" 7src_base = "https://github.com/embassy-rs/embassy/blob/embassy-usb-hid-v$VERSION/embassy-usb-hid/src/"
8src_base_git = "https://github.com/embassy-rs/embassy/blob/$COMMIT/embassy-usb-hid/src/" 8src_base_git = "https://github.com/embassy-rs/embassy/blob/$COMMIT/embassy-usb-hid/src/"
9features = ["defmt", "embassy/time-tick-1mhz"] 9features = ["defmt", "embassy-executor/time-tick-1mhz"]
10flavors = [ 10flavors = [
11 { name = "default", target = "thumbv7em-none-eabihf" }, 11 { name = "default", target = "thumbv7em-none-eabihf" },
12] 12]
@@ -16,7 +16,7 @@ default = ["usbd-hid"]
16usbd-hid = ["dep:usbd-hid", "ssmarshal"] 16usbd-hid = ["dep:usbd-hid", "ssmarshal"]
17 17
18[dependencies] 18[dependencies]
19embassy = { version = "0.1.0", path = "../embassy" } 19embassy-util = { version = "0.1.0", path = "../embassy-util" }
20embassy-usb = { version = "0.1.0", path = "../embassy-usb" } 20embassy-usb = { version = "0.1.0", path = "../embassy-usb" }
21 21
22defmt = { version = "0.3", optional = true } 22defmt = { version = "0.3", optional = true }
diff --git a/embassy-usb-hid/src/lib.rs b/embassy-usb-hid/src/lib.rs
index b87f57481..5fee60bbc 100644
--- a/embassy-usb-hid/src/lib.rs
+++ b/embassy-usb-hid/src/lib.rs
@@ -11,7 +11,6 @@ use core::mem::MaybeUninit;
11use core::ops::Range; 11use core::ops::Range;
12use core::sync::atomic::{AtomicUsize, Ordering}; 12use core::sync::atomic::{AtomicUsize, Ordering};
13 13
14use embassy::time::Duration;
15use embassy_usb::control::{ControlHandler, InResponse, OutResponse, Request, RequestType}; 14use embassy_usb::control::{ControlHandler, InResponse, OutResponse, Request, RequestType};
16use embassy_usb::driver::{Driver, Endpoint, EndpointError, EndpointIn, EndpointOut}; 15use embassy_usb::driver::{Driver, Endpoint, EndpointError, EndpointIn, EndpointOut};
17use embassy_usb::Builder; 16use embassy_usb::Builder;
@@ -373,7 +372,7 @@ pub trait RequestHandler {
373 /// If `id` is `None`, get the idle rate for all reports. Returning `None` 372 /// If `id` is `None`, get the idle rate for all reports. Returning `None`
374 /// will reject the control request. Any duration at or above 1.024 seconds 373 /// will reject the control request. Any duration at or above 1.024 seconds
375 /// or below 4ms will be returned as an indefinite idle rate. 374 /// or below 4ms will be returned as an indefinite idle rate.
376 fn get_idle(&self, id: Option<ReportId>) -> Option<Duration> { 375 fn get_idle_ms(&self, id: Option<ReportId>) -> Option<u32> {
377 let _ = id; 376 let _ = id;
378 None 377 None
379 } 378 }
@@ -381,9 +380,9 @@ pub trait RequestHandler {
381 /// Set the idle rate for `id` to `dur`. 380 /// Set the idle rate for `id` to `dur`.
382 /// 381 ///
383 /// If `id` is `None`, set the idle rate of all input reports to `dur`. If 382 /// If `id` is `None`, set the idle rate of all input reports to `dur`. If
384 /// an indefinite duration is requested, `dur` will be set to `Duration::MAX`. 383 /// an indefinite duration is requested, `dur` will be set to `u32::MAX`.
385 fn set_idle(&self, id: Option<ReportId>, dur: Duration) { 384 fn set_idle_ms(&self, id: Option<ReportId>, duration_ms: u32) {
386 let _ = (id, dur); 385 let _ = (id, duration_ms);
387 } 386 }
388} 387}
389 388
@@ -447,13 +446,9 @@ impl<'d> ControlHandler for Control<'d> {
447 if let Some(handler) = self.request_handler { 446 if let Some(handler) = self.request_handler {
448 let id = req.value as u8; 447 let id = req.value as u8;
449 let id = (id != 0).then(|| ReportId::In(id)); 448 let id = (id != 0).then(|| ReportId::In(id));
450 let dur = u64::from(req.value >> 8); 449 let dur = u32::from(req.value >> 8);
451 let dur = if dur == 0 { 450 let dur = if dur == 0 { u32::MAX } else { 4 * dur };
452 Duration::MAX 451 handler.set_idle_ms(id, dur);
453 } else {
454 Duration::from_millis(4 * dur)
455 };
456 handler.set_idle(id, dur);
457 } 452 }
458 OutResponse::Accepted 453 OutResponse::Accepted
459 } 454 }
@@ -495,8 +490,8 @@ impl<'d> ControlHandler for Control<'d> {
495 if let Some(handler) = self.request_handler { 490 if let Some(handler) = self.request_handler {
496 let id = req.value as u8; 491 let id = req.value as u8;
497 let id = (id != 0).then(|| ReportId::In(id)); 492 let id = (id != 0).then(|| ReportId::In(id));
498 if let Some(dur) = handler.get_idle(id) { 493 if let Some(dur) = handler.get_idle_ms(id) {
499 let dur = u8::try_from(dur.as_millis() / 4).unwrap_or(0); 494 let dur = u8::try_from(dur / 4).unwrap_or(0);
500 buf[0] = dur; 495 buf[0] = dur;
501 InResponse::Accepted(&buf[0..1]) 496 InResponse::Accepted(&buf[0..1])
502 } else { 497 } else {
diff --git a/embassy-usb-ncm/Cargo.toml b/embassy-usb-ncm/Cargo.toml
index 636a81c2c..fa6fa0176 100644
--- a/embassy-usb-ncm/Cargo.toml
+++ b/embassy-usb-ncm/Cargo.toml
@@ -12,7 +12,7 @@ flavors = [
12] 12]
13 13
14[dependencies] 14[dependencies]
15embassy = { version = "0.1.0", path = "../embassy" } 15embassy-util = { version = "0.1.0", path = "../embassy-util" }
16embassy-usb = { version = "0.1.0", path = "../embassy-usb" } 16embassy-usb = { version = "0.1.0", path = "../embassy-usb" }
17 17
18defmt = { version = "0.3", optional = true } 18defmt = { version = "0.3", optional = true }
diff --git a/embassy-usb-serial/Cargo.toml b/embassy-usb-serial/Cargo.toml
index 682707afe..495dd9fea 100644
--- a/embassy-usb-serial/Cargo.toml
+++ b/embassy-usb-serial/Cargo.toml
@@ -12,7 +12,7 @@ flavors = [
12] 12]
13 13
14[dependencies] 14[dependencies]
15embassy = { version = "0.1.0", path = "../embassy" } 15embassy-util = { version = "0.1.0", path = "../embassy-util" }
16embassy-usb = { version = "0.1.0", path = "../embassy-usb" } 16embassy-usb = { version = "0.1.0", path = "../embassy-usb" }
17 17
18defmt = { version = "0.3", optional = true } 18defmt = { version = "0.3", optional = true }
diff --git a/embassy-usb-serial/src/lib.rs b/embassy-usb-serial/src/lib.rs
index a23d62e65..e561be9df 100644
--- a/embassy-usb-serial/src/lib.rs
+++ b/embassy-usb-serial/src/lib.rs
@@ -9,11 +9,11 @@ use core::cell::Cell;
9use core::mem::{self, MaybeUninit}; 9use core::mem::{self, MaybeUninit};
10use core::sync::atomic::{AtomicBool, Ordering}; 10use core::sync::atomic::{AtomicBool, Ordering};
11 11
12use embassy::blocking_mutex::CriticalSectionMutex;
13use embassy_usb::control::{self, ControlHandler, InResponse, OutResponse, Request}; 12use embassy_usb::control::{self, ControlHandler, InResponse, OutResponse, Request};
14use embassy_usb::driver::{Driver, Endpoint, EndpointError, EndpointIn, EndpointOut}; 13use embassy_usb::driver::{Driver, Endpoint, EndpointError, EndpointIn, EndpointOut};
15use embassy_usb::types::*; 14use embassy_usb::types::*;
16use embassy_usb::Builder; 15use embassy_usb::Builder;
16use embassy_util::blocking_mutex::CriticalSectionMutex;
17 17
18/// This should be used as `device_class` when building the `UsbDevice`. 18/// This should be used as `device_class` when building the `UsbDevice`.
19pub const USB_CLASS_CDC: u8 = 0x02; 19pub const USB_CLASS_CDC: u8 = 0x02;
diff --git a/embassy-usb/Cargo.toml b/embassy-usb/Cargo.toml
index 513dc8c1f..98734e98f 100644
--- a/embassy-usb/Cargo.toml
+++ b/embassy-usb/Cargo.toml
@@ -12,7 +12,7 @@ flavors = [
12] 12]
13 13
14[dependencies] 14[dependencies]
15embassy = { version = "0.1.0", path = "../embassy" } 15embassy-util = { version = "0.1.0", path = "../embassy-util" }
16 16
17defmt = { version = "0.3", optional = true } 17defmt = { version = "0.3", optional = true }
18log = { version = "0.4.14", optional = true } 18log = { version = "0.4.14", optional = true }
diff --git a/embassy-usb/src/lib.rs b/embassy-usb/src/lib.rs
index 82ff4e32f..3f6e13472 100644
--- a/embassy-usb/src/lib.rs
+++ b/embassy-usb/src/lib.rs
@@ -12,7 +12,7 @@ mod descriptor_reader;
12pub mod driver; 12pub mod driver;
13pub mod types; 13pub mod types;
14 14
15use embassy::util::{select, Either}; 15use embassy_util::{select, Either};
16use heapless::Vec; 16use heapless::Vec;
17 17
18pub use self::builder::{Builder, Config}; 18pub use self::builder::{Builder, Config};
diff --git a/embassy-util/Cargo.toml b/embassy-util/Cargo.toml
new file mode 100644
index 000000000..32b796c0a
--- /dev/null
+++ b/embassy-util/Cargo.toml
@@ -0,0 +1,28 @@
1[package]
2name = "embassy-util"
3version = "0.1.0"
4edition = "2021"
5
6[package.metadata.embassy_docs]
7src_base = "https://github.com/embassy-rs/embassy/blob/embassy-util-v$VERSION/embassy-util/src/"
8src_base_git = "https://github.com/embassy-rs/embassy/blob/$COMMIT/embassy-util/src/"
9features = ["nightly", "defmt", "unstable-traits", "time", "time-tick-1mhz"]
10flavors = [
11 { name = "default", target = "x86_64-unknown-linux-gnu" },
12]
13
14[dependencies]
15defmt = { version = "0.3", optional = true }
16log = { version = "0.4.14", optional = true }
17
18futures-util = { version = "0.3.17", default-features = false }
19atomic-polyfill = "0.1.5"
20critical-section = "0.2.5"
21heapless = "0.7.5"
22cfg-if = "1.0.0"
23
24[dev-dependencies]
25futures-executor = { version = "0.3.17", features = [ "thread-pool" ] }
26futures-test = "0.3.17"
27futures-timer = "3.0.2"
28futures-util = { version = "0.3.17", features = [ "channel" ] }
diff --git a/embassy-util/build.rs b/embassy-util/build.rs
new file mode 100644
index 000000000..6fe82b44f
--- /dev/null
+++ b/embassy-util/build.rs
@@ -0,0 +1,29 @@
1use std::env;
2
3fn main() {
4 let target = env::var("TARGET").unwrap();
5
6 if target.starts_with("thumbv6m-") {
7 println!("cargo:rustc-cfg=cortex_m");
8 println!("cargo:rustc-cfg=armv6m");
9 } else if target.starts_with("thumbv7m-") {
10 println!("cargo:rustc-cfg=cortex_m");
11 println!("cargo:rustc-cfg=armv7m");
12 } else if target.starts_with("thumbv7em-") {
13 println!("cargo:rustc-cfg=cortex_m");
14 println!("cargo:rustc-cfg=armv7m");
15 println!("cargo:rustc-cfg=armv7em"); // (not currently used)
16 } else if target.starts_with("thumbv8m.base") {
17 println!("cargo:rustc-cfg=cortex_m");
18 println!("cargo:rustc-cfg=armv8m");
19 println!("cargo:rustc-cfg=armv8m_base");
20 } else if target.starts_with("thumbv8m.main") {
21 println!("cargo:rustc-cfg=cortex_m");
22 println!("cargo:rustc-cfg=armv8m");
23 println!("cargo:rustc-cfg=armv8m_main");
24 }
25
26 if target.ends_with("-eabihf") {
27 println!("cargo:rustc-cfg=has_fpu");
28 }
29}
diff --git a/embassy/src/blocking_mutex/mod.rs b/embassy-util/src/blocking_mutex/mod.rs
index c9db89f01..8a4a4c642 100644
--- a/embassy/src/blocking_mutex/mod.rs
+++ b/embassy-util/src/blocking_mutex/mod.rs
@@ -34,7 +34,6 @@ unsafe impl<R: RawMutex + Sync, T: ?Sized + Send> Sync for Mutex<R, T> {}
34 34
35impl<R: RawMutex, T> Mutex<R, T> { 35impl<R: RawMutex, T> Mutex<R, T> {
36 /// Creates a new mutex in an unlocked state ready for use. 36 /// Creates a new mutex in an unlocked state ready for use.
37 #[cfg(feature = "nightly")]
38 #[inline] 37 #[inline]
39 pub const fn new(val: T) -> Mutex<R, T> { 38 pub const fn new(val: T) -> Mutex<R, T> {
40 Mutex { 39 Mutex {
@@ -43,16 +42,6 @@ impl<R: RawMutex, T> Mutex<R, T> {
43 } 42 }
44 } 43 }
45 44
46 /// Creates a new mutex in an unlocked state ready for use.
47 #[cfg(not(feature = "nightly"))]
48 #[inline]
49 pub fn new(val: T) -> Mutex<R, T> {
50 Mutex {
51 raw: R::INIT,
52 data: UnsafeCell::new(val),
53 }
54 }
55
56 /// Creates a critical section and grants temporary access to the protected data. 45 /// Creates a critical section and grants temporary access to the protected data.
57 pub fn lock<U>(&self, f: impl FnOnce(&T) -> U) -> U { 46 pub fn lock<U>(&self, f: impl FnOnce(&T) -> U) -> U {
58 self.raw.lock(|| { 47 self.raw.lock(|| {
diff --git a/embassy/src/blocking_mutex/raw.rs b/embassy-util/src/blocking_mutex/raw.rs
index 669a23e31..15796f1b2 100644
--- a/embassy/src/blocking_mutex/raw.rs
+++ b/embassy-util/src/blocking_mutex/raw.rs
@@ -141,7 +141,8 @@ mod thread_mode {
141 return Some("main") == std::thread::current().name(); 141 return Some("main") == std::thread::current().name();
142 142
143 #[cfg(not(feature = "std"))] 143 #[cfg(not(feature = "std"))]
144 return cortex_m::peripheral::SCB::vect_active() == cortex_m::peripheral::scb::VectActive::ThreadMode; 144 // ICSR.VECTACTIVE == 0
145 return unsafe { (0xE000ED04 as *const u32).read_volatile() } & 0x1FF == 0;
145 } 146 }
146} 147}
147#[cfg(any(cortex_m, feature = "std"))] 148#[cfg(any(cortex_m, feature = "std"))]
diff --git a/embassy/src/channel/mod.rs b/embassy-util/src/channel/mod.rs
index 5df1f5c5c..5df1f5c5c 100644
--- a/embassy/src/channel/mod.rs
+++ b/embassy-util/src/channel/mod.rs
diff --git a/embassy/src/channel/mpmc.rs b/embassy-util/src/channel/mpmc.rs
index ca2214bb5..535f77e6f 100644
--- a/embassy/src/channel/mpmc.rs
+++ b/embassy-util/src/channel/mpmc.rs
@@ -19,10 +19,10 @@
19//! 19//!
20 20
21use core::cell::RefCell; 21use core::cell::RefCell;
22use core::future::Future;
22use core::pin::Pin; 23use core::pin::Pin;
23use core::task::{Context, Poll}; 24use core::task::{Context, Poll};
24 25
25use futures::Future;
26use heapless::Deque; 26use heapless::Deque;
27 27
28use crate::blocking_mutex::raw::RawMutex; 28use crate::blocking_mutex::raw::RawMutex;
@@ -373,35 +373,18 @@ where
373 /// Establish a new bounded channel. For example, to create one with a NoopMutex: 373 /// Establish a new bounded channel. For example, to create one with a NoopMutex:
374 /// 374 ///
375 /// ``` 375 /// ```
376 /// use embassy::channel::mpmc::Channel; 376 /// use embassy_util::channel::mpmc::Channel;
377 /// use embassy::blocking_mutex::raw::NoopRawMutex; 377 /// use embassy_util::blocking_mutex::raw::NoopRawMutex;
378 /// 378 ///
379 /// // Declare a bounded channel of 3 u32s. 379 /// // Declare a bounded channel of 3 u32s.
380 /// let mut channel = Channel::<NoopRawMutex, u32, 3>::new(); 380 /// let mut channel = Channel::<NoopRawMutex, u32, 3>::new();
381 /// ``` 381 /// ```
382 #[cfg(feature = "nightly")]
383 pub const fn new() -> Self { 382 pub const fn new() -> Self {
384 Self { 383 Self {
385 inner: Mutex::new(RefCell::new(ChannelState::new())), 384 inner: Mutex::new(RefCell::new(ChannelState::new())),
386 } 385 }
387 } 386 }
388 387
389 /// Establish a new bounded channel. For example, to create one with a NoopMutex:
390 ///
391 /// ```
392 /// use embassy::channel::mpmc::Channel;
393 /// use embassy::blocking_mutex::raw::NoopRawMutex;
394 ///
395 /// // Declare a bounded channel of 3 u32s.
396 /// let mut channel = Channel::<NoopRawMutex, u32, 3>::new();
397 /// ```
398 #[cfg(not(feature = "nightly"))]
399 pub fn new() -> Self {
400 Self {
401 inner: Mutex::new(RefCell::new(ChannelState::new())),
402 }
403 }
404
405 fn lock<R>(&self, f: impl FnOnce(&mut ChannelState<T, N>) -> R) -> R { 388 fn lock<R>(&self, f: impl FnOnce(&mut ChannelState<T, N>) -> R) -> R {
406 self.inner.lock(|rc| f(&mut *rc.borrow_mut())) 389 self.inner.lock(|rc| f(&mut *rc.borrow_mut()))
407 } 390 }
@@ -485,13 +468,13 @@ where
485mod tests { 468mod tests {
486 use core::time::Duration; 469 use core::time::Duration;
487 470
488 use futures::task::SpawnExt;
489 use futures_executor::ThreadPool; 471 use futures_executor::ThreadPool;
490 use futures_timer::Delay; 472 use futures_timer::Delay;
473 use futures_util::task::SpawnExt;
491 474
492 use super::*; 475 use super::*;
493 use crate::blocking_mutex::raw::{CriticalSectionRawMutex, NoopRawMutex}; 476 use crate::blocking_mutex::raw::{CriticalSectionRawMutex, NoopRawMutex};
494 use crate::util::Forever; 477 use crate::Forever;
495 478
496 fn capacity<T, const N: usize>(c: &ChannelState<T, N>) -> usize { 479 fn capacity<T, const N: usize>(c: &ChannelState<T, N>) -> usize {
497 c.queue.capacity() - c.queue.len() 480 c.queue.capacity() - c.queue.len()
diff --git a/embassy/src/channel/pubsub/mod.rs b/embassy-util/src/channel/pubsub/mod.rs
index 64a72a52c..ecc8fbd8f 100644
--- a/embassy/src/channel/pubsub/mod.rs
+++ b/embassy-util/src/channel/pubsub/mod.rs
@@ -33,9 +33,9 @@ pub use subscriber::{DynSubscriber, Subscriber};
33/// ## Example 33/// ## Example
34/// 34///
35/// ``` 35/// ```
36/// # use embassy::blocking_mutex::raw::NoopRawMutex; 36/// # use embassy_util::blocking_mutex::raw::NoopRawMutex;
37/// # use embassy::channel::pubsub::WaitResult; 37/// # use embassy_util::channel::pubsub::WaitResult;
38/// # use embassy::channel::pubsub::PubSubChannel; 38/// # use embassy_util::channel::pubsub::PubSubChannel;
39/// # use futures_executor::block_on; 39/// # use futures_executor::block_on;
40/// # let test = async { 40/// # let test = async {
41/// // Create the channel. This can be static as well 41/// // Create the channel. This can be static as well
diff --git a/embassy/src/channel/pubsub/publisher.rs b/embassy-util/src/channel/pubsub/publisher.rs
index 53b0d43ba..705797f60 100644
--- a/embassy/src/channel/pubsub/publisher.rs
+++ b/embassy-util/src/channel/pubsub/publisher.rs
@@ -1,12 +1,11 @@
1//! Implementation of anything directly publisher related 1//! Implementation of anything directly publisher related
2 2
3use core::future::Future;
3use core::marker::PhantomData; 4use core::marker::PhantomData;
4use core::ops::{Deref, DerefMut}; 5use core::ops::{Deref, DerefMut};
5use core::pin::Pin; 6use core::pin::Pin;
6use core::task::{Context, Poll}; 7use core::task::{Context, Poll};
7 8
8use futures::Future;
9
10use super::{PubSubBehavior, PubSubChannel}; 9use super::{PubSubBehavior, PubSubChannel};
11use crate::blocking_mutex::raw::RawMutex; 10use crate::blocking_mutex::raw::RawMutex;
12 11
diff --git a/embassy/src/channel/pubsub/subscriber.rs b/embassy-util/src/channel/pubsub/subscriber.rs
index 23c4938d9..b9a2cbe18 100644
--- a/embassy/src/channel/pubsub/subscriber.rs
+++ b/embassy-util/src/channel/pubsub/subscriber.rs
@@ -1,12 +1,11 @@
1//! Implementation of anything directly subscriber related 1//! Implementation of anything directly subscriber related
2 2
3use core::future::Future;
3use core::marker::PhantomData; 4use core::marker::PhantomData;
4use core::ops::{Deref, DerefMut}; 5use core::ops::{Deref, DerefMut};
5use core::pin::Pin; 6use core::pin::Pin;
6use core::task::{Context, Poll}; 7use core::task::{Context, Poll};
7 8
8use futures::Future;
9
10use super::{PubSubBehavior, PubSubChannel, WaitResult}; 9use super::{PubSubBehavior, PubSubChannel, WaitResult};
11use crate::blocking_mutex::raw::RawMutex; 10use crate::blocking_mutex::raw::RawMutex;
12 11
@@ -77,7 +76,7 @@ impl<'a, PSB: PubSubBehavior<T> + ?Sized, T: Clone> Unpin for Sub<'a, PSB, T> {}
77 76
78/// Warning: The stream implementation ignores lag results and returns all messages. 77/// Warning: The stream implementation ignores lag results and returns all messages.
79/// This might miss some messages without you knowing it. 78/// This might miss some messages without you knowing it.
80impl<'a, PSB: PubSubBehavior<T> + ?Sized, T: Clone> futures::Stream for Sub<'a, PSB, T> { 79impl<'a, PSB: PubSubBehavior<T> + ?Sized, T: Clone> futures_util::Stream for Sub<'a, PSB, T> {
81 type Item = T; 80 type Item = T;
82 81
83 fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>> { 82 fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>> {
diff --git a/embassy/src/channel/signal.rs b/embassy-util/src/channel/signal.rs
index 3f3c482fb..a58469c4f 100644
--- a/embassy/src/channel/signal.rs
+++ b/embassy-util/src/channel/signal.rs
@@ -19,7 +19,7 @@ use core::task::{Context, Poll, Waker};
19/// Signals are generally declared as `static`s and then borrowed as required. 19/// Signals are generally declared as `static`s and then borrowed as required.
20/// 20///
21/// ``` 21/// ```
22/// use embassy::channel::signal::Signal; 22/// use embassy_util::channel::signal::Signal;
23/// 23///
24/// enum SomeCommand { 24/// enum SomeCommand {
25/// On, 25/// On,
@@ -89,7 +89,7 @@ impl<T: Send> Signal<T> {
89 89
90 /// Future that completes when this Signal has been signaled. 90 /// Future that completes when this Signal has been signaled.
91 pub fn wait(&self) -> impl Future<Output = T> + '_ { 91 pub fn wait(&self) -> impl Future<Output = T> + '_ {
92 futures::future::poll_fn(move |cx| self.poll_wait(cx)) 92 futures_util::future::poll_fn(move |cx| self.poll_wait(cx))
93 } 93 }
94 94
95 /// non-blocking method to check whether this signal has been signaled. 95 /// non-blocking method to check whether this signal has been signaled.
diff --git a/embassy-util/src/fmt.rs b/embassy-util/src/fmt.rs
new file mode 100644
index 000000000..f8bb0a035
--- /dev/null
+++ b/embassy-util/src/fmt.rs
@@ -0,0 +1,228 @@
1#![macro_use]
2#![allow(unused_macros)]
3
4#[cfg(all(feature = "defmt", feature = "log"))]
5compile_error!("You may not enable both `defmt` and `log` features.");
6
7macro_rules! assert {
8 ($($x:tt)*) => {
9 {
10 #[cfg(not(feature = "defmt"))]
11 ::core::assert!($($x)*);
12 #[cfg(feature = "defmt")]
13 ::defmt::assert!($($x)*);
14 }
15 };
16}
17
18macro_rules! assert_eq {
19 ($($x:tt)*) => {
20 {
21 #[cfg(not(feature = "defmt"))]
22 ::core::assert_eq!($($x)*);
23 #[cfg(feature = "defmt")]
24 ::defmt::assert_eq!($($x)*);
25 }
26 };
27}
28
29macro_rules! assert_ne {
30 ($($x:tt)*) => {
31 {
32 #[cfg(not(feature = "defmt"))]
33 ::core::assert_ne!($($x)*);
34 #[cfg(feature = "defmt")]
35 ::defmt::assert_ne!($($x)*);
36 }
37 };
38}
39
40macro_rules! debug_assert {
41 ($($x:tt)*) => {
42 {
43 #[cfg(not(feature = "defmt"))]
44 ::core::debug_assert!($($x)*);
45 #[cfg(feature = "defmt")]
46 ::defmt::debug_assert!($($x)*);
47 }
48 };
49}
50
51macro_rules! debug_assert_eq {
52 ($($x:tt)*) => {
53 {
54 #[cfg(not(feature = "defmt"))]
55 ::core::debug_assert_eq!($($x)*);
56 #[cfg(feature = "defmt")]
57 ::defmt::debug_assert_eq!($($x)*);
58 }
59 };
60}
61
62macro_rules! debug_assert_ne {
63 ($($x:tt)*) => {
64 {
65 #[cfg(not(feature = "defmt"))]
66 ::core::debug_assert_ne!($($x)*);
67 #[cfg(feature = "defmt")]
68 ::defmt::debug_assert_ne!($($x)*);
69 }
70 };
71}
72
73macro_rules! todo {
74 ($($x:tt)*) => {
75 {
76 #[cfg(not(feature = "defmt"))]
77 ::core::todo!($($x)*);
78 #[cfg(feature = "defmt")]
79 ::defmt::todo!($($x)*);
80 }
81 };
82}
83
84macro_rules! unreachable {
85 ($($x:tt)*) => {
86 {
87 #[cfg(not(feature = "defmt"))]
88 ::core::unreachable!($($x)*);
89 #[cfg(feature = "defmt")]
90 ::defmt::unreachable!($($x)*);
91 }
92 };
93}
94
95macro_rules! panic {
96 ($($x:tt)*) => {
97 {
98 #[cfg(not(feature = "defmt"))]
99 ::core::panic!($($x)*);
100 #[cfg(feature = "defmt")]
101 ::defmt::panic!($($x)*);
102 }
103 };
104}
105
106macro_rules! trace {
107 ($s:literal $(, $x:expr)* $(,)?) => {
108 {
109 #[cfg(feature = "log")]
110 ::log::trace!($s $(, $x)*);
111 #[cfg(feature = "defmt")]
112 ::defmt::trace!($s $(, $x)*);
113 #[cfg(not(any(feature = "log", feature="defmt")))]
114 let _ = ($( & $x ),*);
115 }
116 };
117}
118
119macro_rules! debug {
120 ($s:literal $(, $x:expr)* $(,)?) => {
121 {
122 #[cfg(feature = "log")]
123 ::log::debug!($s $(, $x)*);
124 #[cfg(feature = "defmt")]
125 ::defmt::debug!($s $(, $x)*);
126 #[cfg(not(any(feature = "log", feature="defmt")))]
127 let _ = ($( & $x ),*);
128 }
129 };
130}
131
132macro_rules! info {
133 ($s:literal $(, $x:expr)* $(,)?) => {
134 {
135 #[cfg(feature = "log")]
136 ::log::info!($s $(, $x)*);
137 #[cfg(feature = "defmt")]
138 ::defmt::info!($s $(, $x)*);
139 #[cfg(not(any(feature = "log", feature="defmt")))]
140 let _ = ($( & $x ),*);
141 }
142 };
143}
144
145macro_rules! warn {
146 ($s:literal $(, $x:expr)* $(,)?) => {
147 {
148 #[cfg(feature = "log")]
149 ::log::warn!($s $(, $x)*);
150 #[cfg(feature = "defmt")]
151 ::defmt::warn!($s $(, $x)*);
152 #[cfg(not(any(feature = "log", feature="defmt")))]
153 let _ = ($( & $x ),*);
154 }
155 };
156}
157
158macro_rules! error {
159 ($s:literal $(, $x:expr)* $(,)?) => {
160 {
161 #[cfg(feature = "log")]
162 ::log::error!($s $(, $x)*);
163 #[cfg(feature = "defmt")]
164 ::defmt::error!($s $(, $x)*);
165 #[cfg(not(any(feature = "log", feature="defmt")))]
166 let _ = ($( & $x ),*);
167 }
168 };
169}
170
171#[cfg(feature = "defmt")]
172macro_rules! unwrap {
173 ($($x:tt)*) => {
174 ::defmt::unwrap!($($x)*)
175 };
176}
177
178#[cfg(not(feature = "defmt"))]
179macro_rules! unwrap {
180 ($arg:expr) => {
181 match $crate::fmt::Try::into_result($arg) {
182 ::core::result::Result::Ok(t) => t,
183 ::core::result::Result::Err(e) => {
184 ::core::panic!("unwrap of `{}` failed: {:?}", ::core::stringify!($arg), e);
185 }
186 }
187 };
188 ($arg:expr, $($msg:expr),+ $(,)? ) => {
189 match $crate::fmt::Try::into_result($arg) {
190 ::core::result::Result::Ok(t) => t,
191 ::core::result::Result::Err(e) => {
192 ::core::panic!("unwrap of `{}` failed: {}: {:?}", ::core::stringify!($arg), ::core::format_args!($($msg,)*), e);
193 }
194 }
195 }
196}
197
198#[cfg(feature = "defmt-timestamp-uptime")]
199defmt::timestamp! {"{=u64:us}", crate::time::Instant::now().as_micros() }
200
201#[derive(Debug, Copy, Clone, Eq, PartialEq)]
202pub struct NoneError;
203
204pub trait Try {
205 type Ok;
206 type Error;
207 fn into_result(self) -> Result<Self::Ok, Self::Error>;
208}
209
210impl<T> Try for Option<T> {
211 type Ok = T;
212 type Error = NoneError;
213
214 #[inline]
215 fn into_result(self) -> Result<T, NoneError> {
216 self.ok_or(NoneError)
217 }
218}
219
220impl<T, E> Try for Result<T, E> {
221 type Ok = T;
222 type Error = E;
223
224 #[inline]
225 fn into_result(self) -> Self {
226 self
227 }
228}
diff --git a/embassy/src/util/forever.rs b/embassy-util/src/forever.rs
index 3d2af38b1..4f3698211 100644
--- a/embassy/src/util/forever.rs
+++ b/embassy-util/src/forever.rs
@@ -12,7 +12,7 @@ use atomic_polyfill::{AtomicBool, Ordering};
12/// Note: IF a global mutable variable is desired, use a CriticalSectionMutex or ThreadModeMutex instead. 12/// Note: IF a global mutable variable is desired, use a CriticalSectionMutex or ThreadModeMutex instead.
13/// 13///
14/// ``` 14/// ```
15/// use embassy::util::Forever; 15/// use embassy_util::Forever;
16/// // Using an integer for the sake of keeping this example self-contained, 16/// // Using an integer for the sake of keeping this example self-contained,
17/// // see https://github.com/embassy-rs/embassy/wiki/Getting-Started for a more "proper" example. 17/// // see https://github.com/embassy-rs/embassy/wiki/Getting-Started for a more "proper" example.
18/// static SOME_INT: Forever<u32> =Forever::new(); 18/// static SOME_INT: Forever<u32> =Forever::new();
diff --git a/embassy-util/src/lib.rs b/embassy-util/src/lib.rs
new file mode 100644
index 000000000..07b1633ea
--- /dev/null
+++ b/embassy-util/src/lib.rs
@@ -0,0 +1,22 @@
1#![cfg_attr(not(any(feature = "std", feature = "wasm")), no_std)]
2#![cfg_attr(feature = "nightly", feature(generic_associated_types, type_alias_impl_trait))]
3#![cfg_attr(all(feature = "nightly", target_arch = "xtensa"), feature(asm_experimental_arch))]
4#![allow(clippy::new_without_default)]
5#![doc = include_str!("../../README.md")]
6#![warn(missing_docs)]
7
8// This mod MUST go first, so that the others see its macros.
9pub(crate) mod fmt;
10
11pub mod blocking_mutex;
12pub mod channel;
13pub mod mutex;
14pub mod waitqueue;
15
16mod forever;
17mod select;
18mod yield_now;
19
20pub use forever::*;
21pub use select::*;
22pub use yield_now::*;
diff --git a/embassy/src/mutex.rs b/embassy-util/src/mutex.rs
index 9cfaaa845..75a6e8dd3 100644
--- a/embassy/src/mutex.rs
+++ b/embassy-util/src/mutex.rs
@@ -5,7 +5,7 @@ use core::cell::{RefCell, UnsafeCell};
5use core::ops::{Deref, DerefMut}; 5use core::ops::{Deref, DerefMut};
6use core::task::Poll; 6use core::task::Poll;
7 7
8use futures::future::poll_fn; 8use futures_util::future::poll_fn;
9 9
10use crate::blocking_mutex::raw::RawMutex; 10use crate::blocking_mutex::raw::RawMutex;
11use crate::blocking_mutex::Mutex as BlockingMutex; 11use crate::blocking_mutex::Mutex as BlockingMutex;
@@ -54,7 +54,6 @@ where
54 M: RawMutex, 54 M: RawMutex,
55{ 55{
56 /// Create a new mutex with the given value. 56 /// Create a new mutex with the given value.
57 #[cfg(feature = "nightly")]
58 pub const fn new(value: T) -> Self { 57 pub const fn new(value: T) -> Self {
59 Self { 58 Self {
60 inner: UnsafeCell::new(value), 59 inner: UnsafeCell::new(value),
@@ -64,18 +63,6 @@ where
64 })), 63 })),
65 } 64 }
66 } 65 }
67
68 /// Create a new mutex with the given value.
69 #[cfg(not(feature = "nightly"))]
70 pub fn new(value: T) -> Self {
71 Self {
72 inner: UnsafeCell::new(value),
73 state: BlockingMutex::new(RefCell::new(State {
74 locked: false,
75 waker: WakerRegistration::new(),
76 })),
77 }
78 }
79} 66}
80 67
81impl<M, T> Mutex<M, T> 68impl<M, T> Mutex<M, T>
diff --git a/embassy/src/util/select.rs b/embassy-util/src/select.rs
index 8cecb7fa0..8cecb7fa0 100644
--- a/embassy/src/util/select.rs
+++ b/embassy-util/src/select.rs
diff --git a/embassy/src/waitqueue/mod.rs b/embassy-util/src/waitqueue/mod.rs
index 5c4e1bc3b..6661a6b61 100644
--- a/embassy/src/waitqueue/mod.rs
+++ b/embassy-util/src/waitqueue/mod.rs
@@ -1,6 +1,5 @@
1//! Async low-level wait queues 1//! Async low-level wait queues
2 2
3#[cfg_attr(feature = "executor-agnostic", path = "waker_agnostic.rs")]
4mod waker; 3mod waker;
5pub use waker::*; 4pub use waker::*;
6 5
diff --git a/embassy/src/waitqueue/multi_waker.rs b/embassy-util/src/waitqueue/multi_waker.rs
index 325d2cb3a..325d2cb3a 100644
--- a/embassy/src/waitqueue/multi_waker.rs
+++ b/embassy-util/src/waitqueue/multi_waker.rs
diff --git a/embassy/src/waitqueue/waker_agnostic.rs b/embassy-util/src/waitqueue/waker.rs
index 64e300eb8..64e300eb8 100644
--- a/embassy/src/waitqueue/waker_agnostic.rs
+++ b/embassy-util/src/waitqueue/waker.rs
diff --git a/embassy/src/util/yield_now.rs b/embassy-util/src/yield_now.rs
index 1ebecb916..1ebecb916 100644
--- a/embassy/src/util/yield_now.rs
+++ b/embassy-util/src/yield_now.rs
diff --git a/embassy/src/util/mod.rs b/embassy/src/util/mod.rs
deleted file mode 100644
index 3ad760cd4..000000000
--- a/embassy/src/util/mod.rs
+++ /dev/null
@@ -1,9 +0,0 @@
1//! Misc utilities
2
3mod forever;
4mod select;
5mod yield_now;
6
7pub use forever::*;
8pub use select::*;
9pub use yield_now::*;
diff --git a/embassy/src/waitqueue/waker.rs b/embassy/src/waitqueue/waker.rs
deleted file mode 100644
index cdc96507f..000000000
--- a/embassy/src/waitqueue/waker.rs
+++ /dev/null
@@ -1,97 +0,0 @@
1use core::ptr::{self, NonNull};
2use core::task::Waker;
3
4use atomic_polyfill::{compiler_fence, AtomicPtr, Ordering};
5
6use crate::executor::raw::{task_from_waker, wake_task, TaskHeader};
7
8/// Utility struct to register and wake a waker.
9///
10/// # Safety
11///
12/// This type is optimized for (and only works with) embassy tasks.
13#[derive(Debug)]
14pub struct WakerRegistration {
15 waker: Option<NonNull<TaskHeader>>,
16}
17
18impl WakerRegistration {
19 /// Create a new `WakerRegistration`.
20 pub const fn new() -> Self {
21 Self { waker: None }
22 }
23
24 /// Register a waker. Overwrites the previous waker, if any.
25 pub fn register(&mut self, w: &Waker) {
26 let w = task_from_waker(w);
27 match self.waker {
28 // Optimization: If both the old and new Wakers wake the same task, do nothing.
29 Some(w2) if w == w2 => {}
30 Some(w2) => {
31 // We had a waker registered for another task. Wake it, so the other task can
32 // reregister itself if it's still interested.
33 //
34 // If two tasks are waiting on the same thing concurrently, this will cause them
35 // to wake each other in a loop fighting over this WakerRegistration. This wastes
36 // CPU but things will still work.
37 //
38 // If the user wants to have two tasks waiting on the same thing they should use
39 // a more appropriate primitive that can store multiple wakers.
40
41 unsafe { wake_task(w2) }
42 self.waker = Some(w);
43 }
44 None => self.waker = Some(w),
45 }
46 }
47
48 /// Wake the registered waker, if any.
49 pub fn wake(&mut self) {
50 if let Some(w) = self.waker.take() {
51 unsafe { wake_task(w) }
52 }
53 }
54
55 /// Returns true if a waker is currently registered
56 pub fn occupied(&self) -> bool {
57 self.waker.is_some()
58 }
59}
60
61// SAFETY: `WakerRegistration` effectively contains an `Option<Waker>`,
62// which is `Send` and `Sync`.
63unsafe impl Send for WakerRegistration {}
64unsafe impl Sync for WakerRegistration {}
65
66/// Utility struct to atomically register and wake a waker.
67///
68/// # Safety
69///
70/// This type is optimized for (and only works with) embassy tasks.
71pub struct AtomicWaker {
72 waker: AtomicPtr<TaskHeader>,
73}
74
75impl AtomicWaker {
76 /// Create a new `AtomicWaker`.
77 pub const fn new() -> Self {
78 Self {
79 waker: AtomicPtr::new(ptr::null_mut()),
80 }
81 }
82
83 /// Register a waker. Overwrites the previous waker, if any.
84 pub fn register(&self, w: &Waker) {
85 let w = task_from_waker(w);
86 self.waker.store(w.as_ptr(), Ordering::Relaxed);
87 compiler_fence(Ordering::SeqCst);
88 }
89
90 /// Wake the registered waker, if any.
91 pub fn wake(&self) {
92 let w2 = self.waker.load(Ordering::Relaxed);
93 if let Some(w2) = NonNull::new(w2) {
94 unsafe { wake_task(w2) };
95 }
96 }
97}
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();
diff --git a/tests/rp/Cargo.toml b/tests/rp/Cargo.toml
index fe791d0d7..d19243b9d 100644
--- a/tests/rp/Cargo.toml
+++ b/tests/rp/Cargo.toml
@@ -4,7 +4,8 @@ name = "embassy-rp-tests"
4version = "0.1.0" 4version = "0.1.0"
5 5
6[dependencies] 6[dependencies]
7embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt"] } 7embassy-util = { version = "0.1.0", path = "../../embassy-util", features = ["defmt"] }
8embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt"] }
8embassy-rp = { version = "0.1.0", path = "../../embassy-rp", features = ["nightly", "defmt", "unstable-pac", "unstable-traits"] } 9embassy-rp = { version = "0.1.0", path = "../../embassy-rp", features = ["nightly", "defmt", "unstable-pac", "unstable-traits"] }
9 10
10defmt = "0.3.0" 11defmt = "0.3.0"
diff --git a/tests/rp/src/bin/gpio.rs b/tests/rp/src/bin/gpio.rs
index 0be9d9f24..6f6baf77a 100644
--- a/tests/rp/src/bin/gpio.rs
+++ b/tests/rp/src/bin/gpio.rs
@@ -3,12 +3,12 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::{assert, *}; 5use defmt::{assert, *};
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy_rp::gpio::{Flex, Input, Level, Output, OutputOpenDrain, Pull}; 7use embassy_rp::gpio::{Flex, Input, Level, Output, OutputOpenDrain, Pull};
8use embassy_rp::Peripherals; 8use embassy_rp::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/tests/rp/src/bin/gpio_async.rs b/tests/rp/src/bin/gpio_async.rs
index 46df4105c..1098682af 100644
--- a/tests/rp/src/bin/gpio_async.rs
+++ b/tests/rp/src/bin/gpio_async.rs
@@ -3,14 +3,14 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use defmt::{assert, *}; 5use defmt::{assert, *};
6use embassy::executor::Spawner; 6use embassy_executor::executor::Spawner;
7use embassy::time::{Duration, Instant, Timer}; 7use embassy_executor::time::{Duration, Instant, Timer};
8use embassy_rp::gpio::{Input, Level, Output, Pull}; 8use embassy_rp::gpio::{Input, Level, Output, Pull};
9use embassy_rp::Peripherals; 9use embassy_rp::Peripherals;
10use futures::future::join; 10use futures::future::join;
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!("embassy-rp gpio_async test"); 15 info!("embassy-rp gpio_async test");
16 16
diff --git a/tests/stm32/Cargo.toml b/tests/stm32/Cargo.toml
index df8d64449..c1cca99d1 100644
--- a/tests/stm32/Cargo.toml
+++ b/tests/stm32/Cargo.toml
@@ -13,7 +13,8 @@ stm32wb55rg = ["embassy-stm32/stm32wb55rg"] # Nucleo
13stm32u585ai = ["embassy-stm32/stm32u585ai"] # IoT board 13stm32u585ai = ["embassy-stm32/stm32u585ai"] # IoT board
14 14
15[dependencies] 15[dependencies]
16embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt", "time-tick-32768hz"] } 16embassy-util = { version = "0.1.0", path = "../../embassy-util", features = ["defmt"] }
17embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "time-tick-32768hz"] }
17embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "unstable-pac", "memory-x", "time-driver-tim2"] } 18embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "unstable-pac", "memory-x", "time-driver-tim2"] }
18 19
19defmt = "0.3.0" 20defmt = "0.3.0"
diff --git a/tests/stm32/src/bin/gpio.rs b/tests/stm32/src/bin/gpio.rs
index 37cfe7cf4..8eab731bf 100644
--- a/tests/stm32/src/bin/gpio.rs
+++ b/tests/stm32/src/bin/gpio.rs
@@ -5,12 +5,12 @@
5#[path = "../example_common.rs"] 5#[path = "../example_common.rs"]
6mod example_common; 6mod example_common;
7use defmt::assert; 7use defmt::assert;
8use embassy::executor::Spawner; 8use embassy_executor::executor::Spawner;
9use embassy_stm32::gpio::{Flex, Input, Level, Output, OutputOpenDrain, Pull, Speed}; 9use embassy_stm32::gpio::{Flex, Input, Level, Output, OutputOpenDrain, Pull, Speed};
10use embassy_stm32::Peripherals; 10use embassy_stm32::Peripherals;
11use example_common::*; 11use example_common::*;
12 12
13#[embassy::main(config = "config()")] 13#[embassy_executor::main(config = "config()")]
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/tests/stm32/src/bin/spi.rs b/tests/stm32/src/bin/spi.rs
index 049ba1e9f..6d38b0bbf 100644
--- a/tests/stm32/src/bin/spi.rs
+++ b/tests/stm32/src/bin/spi.rs
@@ -5,14 +5,14 @@
5#[path = "../example_common.rs"] 5#[path = "../example_common.rs"]
6mod example_common; 6mod example_common;
7use defmt::assert_eq; 7use defmt::assert_eq;
8use embassy::executor::Spawner; 8use embassy_executor::executor::Spawner;
9use embassy_stm32::dma::NoDma; 9use embassy_stm32::dma::NoDma;
10use embassy_stm32::spi::{self, Spi}; 10use embassy_stm32::spi::{self, Spi};
11use embassy_stm32::time::Hertz; 11use embassy_stm32::time::Hertz;
12use embassy_stm32::Peripherals; 12use embassy_stm32::Peripherals;
13use example_common::*; 13use example_common::*;
14 14
15#[embassy::main(config = "config()")] 15#[embassy_executor::main(config = "config()")]
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/tests/stm32/src/bin/spi_dma.rs b/tests/stm32/src/bin/spi_dma.rs
index 64337886b..8147c5f08 100644
--- a/tests/stm32/src/bin/spi_dma.rs
+++ b/tests/stm32/src/bin/spi_dma.rs
@@ -5,13 +5,13 @@
5#[path = "../example_common.rs"] 5#[path = "../example_common.rs"]
6mod example_common; 6mod example_common;
7use defmt::assert_eq; 7use defmt::assert_eq;
8use embassy::executor::Spawner; 8use embassy_executor::executor::Spawner;
9use embassy_stm32::spi::{self, Spi}; 9use embassy_stm32::spi::{self, Spi};
10use embassy_stm32::time::Hertz; 10use embassy_stm32::time::Hertz;
11use embassy_stm32::Peripherals; 11use embassy_stm32::Peripherals;
12use example_common::*; 12use example_common::*;
13 13
14#[embassy::main(config = "config()")] 14#[embassy_executor::main(config = "config()")]
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/tests/stm32/src/bin/timer.rs b/tests/stm32/src/bin/timer.rs
index 002a8a4d3..76b07ca15 100644
--- a/tests/stm32/src/bin/timer.rs
+++ b/tests/stm32/src/bin/timer.rs
@@ -5,12 +5,12 @@
5#[path = "../example_common.rs"] 5#[path = "../example_common.rs"]
6mod example_common; 6mod example_common;
7use defmt::assert; 7use defmt::assert;
8use embassy::executor::Spawner; 8use embassy_executor::executor::Spawner;
9use embassy::time::{Duration, Instant, Timer}; 9use embassy_executor::time::{Duration, Instant, Timer};
10use embassy_stm32::Peripherals; 10use embassy_stm32::Peripherals;
11use example_common::*; 11use example_common::*;
12 12
13#[embassy::main(config = "config()")] 13#[embassy_executor::main(config = "config()")]
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/tests/stm32/src/bin/usart.rs b/tests/stm32/src/bin/usart.rs
index c3468290e..7b60e4b28 100644
--- a/tests/stm32/src/bin/usart.rs
+++ b/tests/stm32/src/bin/usart.rs
@@ -5,13 +5,13 @@
5#[path = "../example_common.rs"] 5#[path = "../example_common.rs"]
6mod example_common; 6mod example_common;
7use defmt::assert_eq; 7use defmt::assert_eq;
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 example_common::*; 12use example_common::*;
13 13
14#[embassy::main(config = "config()")] 14#[embassy_executor::main(config = "config()")]
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/tests/stm32/src/bin/usart_dma.rs b/tests/stm32/src/bin/usart_dma.rs
index 9946f4a56..323c41cae 100644
--- a/tests/stm32/src/bin/usart_dma.rs
+++ b/tests/stm32/src/bin/usart_dma.rs
@@ -5,12 +5,12 @@
5#[path = "../example_common.rs"] 5#[path = "../example_common.rs"]
6mod example_common; 6mod example_common;
7use defmt::assert_eq; 7use defmt::assert_eq;
8use embassy::executor::Spawner; 8use embassy_executor::executor::Spawner;
9use embassy_stm32::usart::{Config, Uart}; 9use embassy_stm32::usart::{Config, Uart};
10use embassy_stm32::Peripherals; 10use embassy_stm32::Peripherals;
11use example_common::*; 11use example_common::*;
12 12
13#[embassy::main(config = "config()")] 13#[embassy_executor::main(config = "config()")]
14async fn main(_spawner: Spawner, p: Peripherals) { 14async fn main(_spawner: Spawner, p: Peripherals) {
15 info!("Hello World!"); 15 info!("Hello World!");
16 16