diff options
118 files changed, 391 insertions, 142 deletions
diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index d76e5ced4..d2e8e316b 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-util && cargo test | 72 | run: cd embassy-sync && cargo test |
diff --git a/.vscode/settings.json b/.vscode/settings.json index d6ce75c99..5e9e51799 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json | |||
| @@ -18,7 +18,7 @@ | |||
| 18 | "rust-analyzer.linkedProjects": [ | 18 | "rust-analyzer.linkedProjects": [ |
| 19 | // Declare for the target you wish to develop | 19 | // Declare for the target you wish to develop |
| 20 | //"embassy-executor/Cargo.toml", | 20 | //"embassy-executor/Cargo.toml", |
| 21 | //"embassy-util/Cargo.toml", | 21 | //"embassy-sync/Cargo.toml", |
| 22 | "examples/nrf/Cargo.toml", | 22 | "examples/nrf/Cargo.toml", |
| 23 | // "examples/rp/Cargo.toml", | 23 | // "examples/rp/Cargo.toml", |
| 24 | // "examples/std/Cargo.toml", | 24 | // "examples/std/Cargo.toml", |
diff --git a/embassy-boot/boot/Cargo.toml b/embassy-boot/boot/Cargo.toml index 9c2e72be5..a42f88688 100644 --- a/embassy-boot/boot/Cargo.toml +++ b/embassy-boot/boot/Cargo.toml | |||
| @@ -14,7 +14,7 @@ target = "thumbv7em-none-eabi" | |||
| 14 | [dependencies] | 14 | [dependencies] |
| 15 | defmt = { version = "0.3", optional = true } | 15 | defmt = { version = "0.3", optional = true } |
| 16 | log = { version = "0.4", optional = true } | 16 | log = { version = "0.4", optional = true } |
| 17 | embassy-util = { version = "0.1.0", path = "../../embassy-util" } | 17 | embassy-sync = { version = "0.1.0", path = "../../embassy-sync" } |
| 18 | embedded-storage = "0.3.0" | 18 | embedded-storage = "0.3.0" |
| 19 | embedded-storage-async = "0.3.0" | 19 | embedded-storage-async = "0.3.0" |
| 20 | 20 | ||
diff --git a/embassy-boot/nrf/Cargo.toml b/embassy-boot/nrf/Cargo.toml index b06e8102c..234393e7c 100644 --- a/embassy-boot/nrf/Cargo.toml +++ b/embassy-boot/nrf/Cargo.toml | |||
| @@ -15,7 +15,7 @@ target = "thumbv7em-none-eabi" | |||
| 15 | [dependencies] | 15 | [dependencies] |
| 16 | defmt = { version = "0.3", optional = true } | 16 | defmt = { version = "0.3", optional = true } |
| 17 | 17 | ||
| 18 | embassy-util = { path = "../../embassy-util" } | 18 | embassy-sync = { path = "../../embassy-sync" } |
| 19 | embassy-nrf = { path = "../../embassy-nrf", default-features = false, features = ["nightly"] } | 19 | embassy-nrf = { path = "../../embassy-nrf", default-features = false, features = ["nightly"] } |
| 20 | embassy-boot = { path = "../boot", default-features = false } | 20 | embassy-boot = { path = "../boot", default-features = false } |
| 21 | cortex-m = { version = "0.7.6" } | 21 | cortex-m = { version = "0.7.6" } |
diff --git a/embassy-boot/stm32/Cargo.toml b/embassy-boot/stm32/Cargo.toml index d8f492531..ad4657e0d 100644 --- a/embassy-boot/stm32/Cargo.toml +++ b/embassy-boot/stm32/Cargo.toml | |||
| @@ -17,7 +17,7 @@ defmt = { version = "0.3", optional = true } | |||
| 17 | defmt-rtt = { version = "0.3", optional = true } | 17 | defmt-rtt = { version = "0.3", optional = true } |
| 18 | log = { version = "0.4", optional = true } | 18 | log = { version = "0.4", optional = true } |
| 19 | 19 | ||
| 20 | embassy-util = { path = "../../embassy-util" } | 20 | embassy-sync = { path = "../../embassy-sync" } |
| 21 | embassy-stm32 = { path = "../../embassy-stm32", default-features = false, features = ["nightly"] } | 21 | embassy-stm32 = { path = "../../embassy-stm32", default-features = false, features = ["nightly"] } |
| 22 | embassy-boot = { path = "../boot", default-features = false } | 22 | embassy-boot = { path = "../boot", default-features = false } |
| 23 | cortex-m = { version = "0.7.6" } | 23 | cortex-m = { version = "0.7.6" } |
diff --git a/embassy-cortex-m/Cargo.toml b/embassy-cortex-m/Cargo.toml index 1f16da31b..7efced669 100644 --- a/embassy-cortex-m/Cargo.toml +++ b/embassy-cortex-m/Cargo.toml | |||
| @@ -35,7 +35,7 @@ prio-bits-8 = [] | |||
| 35 | defmt = { version = "0.3", optional = true } | 35 | defmt = { version = "0.3", optional = true } |
| 36 | log = { version = "0.4.14", optional = true } | 36 | log = { version = "0.4.14", optional = true } |
| 37 | 37 | ||
| 38 | embassy-util = { version = "0.1.0", path = "../embassy-util" } | 38 | embassy-sync = { version = "0.1.0", path = "../embassy-sync" } |
| 39 | embassy-executor = { version = "0.1.0", path = "../embassy-executor"} | 39 | embassy-executor = { version = "0.1.0", path = "../embassy-executor"} |
| 40 | embassy-macros = { version = "0.1.0", path = "../embassy-macros"} | 40 | embassy-macros = { version = "0.1.0", path = "../embassy-macros"} |
| 41 | embassy-hal-common = { version = "0.1.0", path = "../embassy-hal-common"} | 41 | embassy-hal-common = { version = "0.1.0", path = "../embassy-hal-common"} |
diff --git a/embassy-embedded-hal/Cargo.toml b/embassy-embedded-hal/Cargo.toml index 866666871..462680720 100644 --- a/embassy-embedded-hal/Cargo.toml +++ b/embassy-embedded-hal/Cargo.toml | |||
| @@ -16,7 +16,7 @@ std = [] | |||
| 16 | nightly = ["embedded-hal-async", "embedded-storage-async"] | 16 | nightly = ["embedded-hal-async", "embedded-storage-async"] |
| 17 | 17 | ||
| 18 | [dependencies] | 18 | [dependencies] |
| 19 | embassy-util = { version = "0.1.0", path = "../embassy-util" } | 19 | embassy-sync = { version = "0.1.0", path = "../embassy-sync" } |
| 20 | embedded-hal-02 = { package = "embedded-hal", version = "0.2.6", features = ["unproven"] } | 20 | embedded-hal-02 = { package = "embedded-hal", version = "0.2.6", features = ["unproven"] } |
| 21 | embedded-hal-1 = { package = "embedded-hal", version = "1.0.0-alpha.8" } | 21 | embedded-hal-1 = { package = "embedded-hal", version = "1.0.0-alpha.8" } |
| 22 | embedded-hal-async = { version = "0.1.0-alpha.1", optional = true } | 22 | embedded-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 dc483b826..0bc6afd98 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_util::mutex::Mutex; | 7 | //! use embassy_sync::mutex::Mutex; |
| 8 | //! use embassy_util::blocking_mutex::raw::ThreadModeRawMutex; | 8 | //! use embassy_sync::blocking_mutex::raw::ThreadModeRawMutex; |
| 9 | //! | 9 | //! |
| 10 | //! static I2C_BUS: StaticCell<Mutex::<ThreadModeRawMutex, Twim<TWISPI0>>> = StaticCell::new(); | 10 | //! static I2C_BUS: StaticCell<Mutex::<ThreadModeRawMutex, Twim<TWISPI0>>> = StaticCell::new(); |
| 11 | //! let config = twim::Config::default(); | 11 | //! let config = twim::Config::default(); |
| @@ -24,8 +24,8 @@ | |||
| 24 | //! ``` | 24 | //! ``` |
| 25 | use core::future::Future; | 25 | use core::future::Future; |
| 26 | 26 | ||
| 27 | use embassy_util::blocking_mutex::raw::RawMutex; | 27 | use embassy_sync::blocking_mutex::raw::RawMutex; |
| 28 | use embassy_util::mutex::Mutex; | 28 | use embassy_sync::mutex::Mutex; |
| 29 | use embedded_hal_async::i2c; | 29 | use embedded_hal_async::i2c; |
| 30 | 30 | ||
| 31 | use crate::shared_bus::I2cDeviceError; | 31 | use 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 bb419d6a6..c95b59ef0 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_util::mutex::Mutex; | 7 | //! use embassy_sync::mutex::Mutex; |
| 8 | //! use embassy_util::blocking_mutex::raw::ThreadModeRawMutex; | 8 | //! use embassy_sync::blocking_mutex::raw::ThreadModeRawMutex; |
| 9 | //! | 9 | //! |
| 10 | //! static SPI_BUS: StaticCell<Mutex<ThreadModeRawMutex, spim::Spim<SPI3>>> = StaticCell::new(); | 10 | //! static SPI_BUS: StaticCell<Mutex<ThreadModeRawMutex, spim::Spim<SPI3>>> = StaticCell::new(); |
| 11 | //! let mut config = spim::Config::default(); | 11 | //! let mut config = spim::Config::default(); |
| @@ -27,8 +27,8 @@ | |||
| 27 | //! ``` | 27 | //! ``` |
| 28 | use core::future::Future; | 28 | use core::future::Future; |
| 29 | 29 | ||
| 30 | use embassy_util::blocking_mutex::raw::RawMutex; | 30 | use embassy_sync::blocking_mutex::raw::RawMutex; |
| 31 | use embassy_util::mutex::Mutex; | 31 | use embassy_sync::mutex::Mutex; |
| 32 | use embedded_hal_1::digital::blocking::OutputPin; | 32 | use embedded_hal_1::digital::blocking::OutputPin; |
| 33 | use embedded_hal_1::spi::ErrorType; | 33 | use embedded_hal_1::spi::ErrorType; |
| 34 | use embedded_hal_async::spi; | 34 | use 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 837312e87..a611e2d27 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_util::blocking_mutex::{NoopMutex, raw::NoopRawMutex}; | 7 | //! use embassy_sync::blocking_mutex::{NoopMutex, raw::NoopRawMutex}; |
| 8 | //! | 8 | //! |
| 9 | //! static I2C_BUS: StaticCell<NoopMutex<RefCell<Twim<TWISPI0>>>> = StaticCell::new(); | 9 | //! static I2C_BUS: StaticCell<NoopMutex<RefCell<Twim<TWISPI0>>>> = StaticCell::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 | ||
| 19 | use core::cell::RefCell; | 19 | use core::cell::RefCell; |
| 20 | 20 | ||
| 21 | use embassy_util::blocking_mutex::raw::RawMutex; | 21 | use embassy_sync::blocking_mutex::raw::RawMutex; |
| 22 | use embassy_util::blocking_mutex::Mutex; | 22 | use embassy_sync::blocking_mutex::Mutex; |
| 23 | use embedded_hal_1::i2c::blocking::{I2c, Operation}; | 23 | use embedded_hal_1::i2c::blocking::{I2c, Operation}; |
| 24 | use embedded_hal_1::i2c::ErrorType; | 24 | use 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 a48d9183c..23845d887 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_util::blocking_mutex::{NoopMutex, raw::NoopRawMutex}; | 7 | //! use embassy_sync::blocking_mutex::{NoopMutex, raw::NoopRawMutex}; |
| 8 | //! | 8 | //! |
| 9 | //! static SPI_BUS: StaticCell<NoopMutex<RefCell<Spim<SPI3>>>> = StaticCell::new(); | 9 | //! static SPI_BUS: StaticCell<NoopMutex<RefCell<Spim<SPI3>>>> = StaticCell::new(); |
| 10 | //! let irq = interrupt::take!(SPIM3); | 10 | //! let irq = interrupt::take!(SPIM3); |
| @@ -20,8 +20,8 @@ | |||
| 20 | 20 | ||
| 21 | use core::cell::RefCell; | 21 | use core::cell::RefCell; |
| 22 | 22 | ||
| 23 | use embassy_util::blocking_mutex::raw::RawMutex; | 23 | use embassy_sync::blocking_mutex::raw::RawMutex; |
| 24 | use embassy_util::blocking_mutex::Mutex; | 24 | use embassy_sync::blocking_mutex::Mutex; |
| 25 | use embedded_hal_1::digital::blocking::OutputPin; | 25 | use embedded_hal_1::digital::blocking::OutputPin; |
| 26 | use embedded_hal_1::spi; | 26 | use embedded_hal_1::spi; |
| 27 | use embedded_hal_1::spi::blocking::SpiBusFlush; | 27 | use embedded_hal_1::spi::blocking::SpiBusFlush; |
diff --git a/embassy-futures/Cargo.toml b/embassy-futures/Cargo.toml new file mode 100644 index 000000000..e564f5a96 --- /dev/null +++ b/embassy-futures/Cargo.toml | |||
| @@ -0,0 +1,14 @@ | |||
| 1 | [package] | ||
| 2 | name = "embassy-futures" | ||
| 3 | version = "0.1.0" | ||
| 4 | edition = "2021" | ||
| 5 | |||
| 6 | [package.metadata.embassy_docs] | ||
| 7 | src_base = "https://github.com/embassy-rs/embassy/blob/embassy-futures-v$VERSION/embassy-futures/src/" | ||
| 8 | src_base_git = "https://github.com/embassy-rs/embassy/blob/$COMMIT/embassy-futures/src/" | ||
| 9 | features = ["nightly"] | ||
| 10 | target = "thumbv7em-none-eabi" | ||
| 11 | |||
| 12 | [dependencies] | ||
| 13 | defmt = { version = "0.3", optional = true } | ||
| 14 | log = { version = "0.4.14", optional = true } | ||
diff --git a/embassy-util/src/fmt.rs b/embassy-futures/src/fmt.rs index f8bb0a035..f8bb0a035 100644 --- a/embassy-util/src/fmt.rs +++ b/embassy-futures/src/fmt.rs | |||
diff --git a/embassy-futures/src/lib.rs b/embassy-futures/src/lib.rs new file mode 100644 index 000000000..48c9c8574 --- /dev/null +++ b/embassy-futures/src/lib.rs | |||
| @@ -0,0 +1,12 @@ | |||
| 1 | #![no_std] | ||
| 2 | #![doc = include_str!("../../README.md")] | ||
| 3 | #![warn(missing_docs)] | ||
| 4 | |||
| 5 | // This mod MUST go first, so that the others see its macros. | ||
| 6 | pub(crate) mod fmt; | ||
| 7 | |||
| 8 | mod select; | ||
| 9 | mod yield_now; | ||
| 10 | |||
| 11 | pub use select::*; | ||
| 12 | pub use yield_now::*; | ||
diff --git a/embassy-util/src/select.rs b/embassy-futures/src/select.rs index 8cecb7fa0..8cecb7fa0 100644 --- a/embassy-util/src/select.rs +++ b/embassy-futures/src/select.rs | |||
diff --git a/embassy-util/src/yield_now.rs b/embassy-futures/src/yield_now.rs index 1ebecb916..1ebecb916 100644 --- a/embassy-util/src/yield_now.rs +++ b/embassy-futures/src/yield_now.rs | |||
diff --git a/embassy-lora/Cargo.toml b/embassy-lora/Cargo.toml index c7435ab3e..9d5e7aed2 100644 --- a/embassy-lora/Cargo.toml +++ b/embassy-lora/Cargo.toml | |||
| @@ -25,7 +25,7 @@ defmt = { version = "0.3", optional = true } | |||
| 25 | log = { version = "0.4.14", optional = true } | 25 | log = { version = "0.4.14", optional = true } |
| 26 | 26 | ||
| 27 | embassy-time = { version = "0.1.0", path = "../embassy-time" } | 27 | embassy-time = { version = "0.1.0", path = "../embassy-time" } |
| 28 | embassy-util = { version = "0.1.0", path = "../embassy-util" } | 28 | embassy-sync = { version = "0.1.0", path = "../embassy-sync" } |
| 29 | embassy-stm32 = { version = "0.1.0", path = "../embassy-stm32", default-features = false, optional = true } | 29 | embassy-stm32 = { version = "0.1.0", path = "../embassy-stm32", default-features = false, optional = true } |
| 30 | embedded-hal-1 = { package = "embedded-hal", version = "1.0.0-alpha.8" } | 30 | embedded-hal-1 = { package = "embedded-hal", version = "1.0.0-alpha.8" } |
| 31 | embedded-hal-async = { version = "0.1.0-alpha.1" } | 31 | embedded-hal-async = { version = "0.1.0-alpha.1" } |
diff --git a/embassy-lora/src/stm32wl/mod.rs b/embassy-lora/src/stm32wl/mod.rs index 4a4c5cfb7..374c8532f 100644 --- a/embassy-lora/src/stm32wl/mod.rs +++ b/embassy-lora/src/stm32wl/mod.rs | |||
| @@ -12,7 +12,7 @@ use embassy_stm32::subghz::{ | |||
| 12 | Status, SubGhz, TcxoMode, TcxoTrim, Timeout, TxParams, | 12 | Status, SubGhz, TcxoMode, TcxoTrim, Timeout, TxParams, |
| 13 | }; | 13 | }; |
| 14 | use embassy_stm32::Peripheral; | 14 | use embassy_stm32::Peripheral; |
| 15 | use embassy_util::channel::signal::Signal; | 15 | use embassy_sync::channel::signal::Signal; |
| 16 | use lorawan_device::async_device::radio::{Bandwidth, PhyRxTx, RfConfig, RxQuality, SpreadingFactor, TxConfig}; | 16 | use lorawan_device::async_device::radio::{Bandwidth, PhyRxTx, RfConfig, RxQuality, SpreadingFactor, TxConfig}; |
| 17 | use lorawan_device::async_device::Timings; | 17 | use lorawan_device::async_device::Timings; |
| 18 | 18 | ||
diff --git a/embassy-net/Cargo.toml b/embassy-net/Cargo.toml index 9f9bb2261..2143f36d3 100644 --- a/embassy-net/Cargo.toml +++ b/embassy-net/Cargo.toml | |||
| @@ -38,7 +38,7 @@ defmt = { version = "0.3", optional = true } | |||
| 38 | log = { version = "0.4.14", optional = true } | 38 | log = { version = "0.4.14", optional = true } |
| 39 | 39 | ||
| 40 | embassy-time = { version = "0.1.0", path = "../embassy-time" } | 40 | embassy-time = { version = "0.1.0", path = "../embassy-time" } |
| 41 | embassy-util = { version = "0.1.0", path = "../embassy-util" } | 41 | embassy-sync = { version = "0.1.0", path = "../embassy-sync" } |
| 42 | embedded-io = { version = "0.3.0", features = [ "async" ] } | 42 | embedded-io = { version = "0.3.0", features = [ "async" ] } |
| 43 | 43 | ||
| 44 | managed = { version = "0.8.0", default-features = false, features = [ "map" ] } | 44 | managed = { version = "0.8.0", default-features = false, features = [ "map" ] } |
diff --git a/embassy-net/src/stack.rs b/embassy-net/src/stack.rs index 4b6a7ae2a..8d2dd4bca 100644 --- a/embassy-net/src/stack.rs +++ b/embassy-net/src/stack.rs | |||
| @@ -2,8 +2,8 @@ use core::cell::UnsafeCell; | |||
| 2 | use core::future::Future; | 2 | use core::future::Future; |
| 3 | use core::task::{Context, Poll}; | 3 | use core::task::{Context, Poll}; |
| 4 | 4 | ||
| 5 | use embassy_sync::waitqueue::WakerRegistration; | ||
| 5 | use embassy_time::{Instant, Timer}; | 6 | use embassy_time::{Instant, Timer}; |
| 6 | use embassy_util::waitqueue::WakerRegistration; | ||
| 7 | use futures::future::poll_fn; | 7 | use futures::future::poll_fn; |
| 8 | use futures::pin_mut; | 8 | use futures::pin_mut; |
| 9 | use heapless::Vec; | 9 | use heapless::Vec; |
diff --git a/embassy-nrf/Cargo.toml b/embassy-nrf/Cargo.toml index 0ef7f5bbd..186c73a58 100644 --- a/embassy-nrf/Cargo.toml +++ b/embassy-nrf/Cargo.toml | |||
| @@ -18,7 +18,7 @@ flavors = [ | |||
| 18 | 18 | ||
| 19 | time = ["dep:embassy-time"] | 19 | time = ["dep:embassy-time"] |
| 20 | 20 | ||
| 21 | defmt = ["dep:defmt", "embassy-executor/defmt", "embassy-util/defmt", "embassy-usb?/defmt", "embedded-io?/defmt", "embassy-embedded-hal/defmt"] | 21 | defmt = ["dep:defmt", "embassy-executor/defmt", "embassy-sync/defmt", "embassy-usb?/defmt", "embedded-io?/defmt", "embassy-embedded-hal/defmt"] |
| 22 | 22 | ||
| 23 | # Enable nightly-only features | 23 | # Enable nightly-only features |
| 24 | nightly = ["embedded-hal-1", "embedded-hal-async", "embassy-usb", "embedded-storage-async", "dep:embedded-io", "embassy-embedded-hal/nightly"] | 24 | nightly = ["embedded-hal-1", "embedded-hal-async", "embassy-usb", "embedded-storage-async", "dep:embedded-io", "embassy-embedded-hal/nightly"] |
| @@ -66,7 +66,7 @@ _gpio-p1 = [] | |||
| 66 | [dependencies] | 66 | [dependencies] |
| 67 | embassy-executor = { version = "0.1.0", path = "../embassy-executor", optional = true } | 67 | embassy-executor = { version = "0.1.0", path = "../embassy-executor", optional = true } |
| 68 | embassy-time = { version = "0.1.0", path = "../embassy-time", optional = true } | 68 | embassy-time = { version = "0.1.0", path = "../embassy-time", optional = true } |
| 69 | embassy-util = { version = "0.1.0", path = "../embassy-util" } | 69 | embassy-sync = { version = "0.1.0", path = "../embassy-sync" } |
| 70 | embassy-cortex-m = { version = "0.1.0", path = "../embassy-cortex-m", features = ["prio-bits-3"]} | 70 | embassy-cortex-m = { version = "0.1.0", path = "../embassy-cortex-m", features = ["prio-bits-3"]} |
| 71 | embassy-hal-common = {version = "0.1.0", path = "../embassy-hal-common" } | 71 | embassy-hal-common = {version = "0.1.0", path = "../embassy-hal-common" } |
| 72 | embassy-embedded-hal = {version = "0.1.0", path = "../embassy-embedded-hal" } | 72 | embassy-embedded-hal = {version = "0.1.0", path = "../embassy-embedded-hal" } |
diff --git a/embassy-nrf/src/buffered_uarte.rs b/embassy-nrf/src/buffered_uarte.rs index 08dfcbcf9..62af544ae 100644 --- a/embassy-nrf/src/buffered_uarte.rs +++ b/embassy-nrf/src/buffered_uarte.rs | |||
| @@ -21,7 +21,7 @@ use core::task::Poll; | |||
| 21 | use embassy_cortex_m::peripheral::{PeripheralMutex, PeripheralState, StateStorage}; | 21 | use embassy_cortex_m::peripheral::{PeripheralMutex, PeripheralState, StateStorage}; |
| 22 | use embassy_hal_common::ring_buffer::RingBuffer; | 22 | use embassy_hal_common::ring_buffer::RingBuffer; |
| 23 | use embassy_hal_common::{into_ref, PeripheralRef}; | 23 | use embassy_hal_common::{into_ref, PeripheralRef}; |
| 24 | use embassy_util::waitqueue::WakerRegistration; | 24 | use embassy_sync::waitqueue::WakerRegistration; |
| 25 | use futures::future::poll_fn; | 25 | use 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 |
| 27 | pub use pac::uarte0::{baudrate::BAUDRATE_A as Baudrate, config::PARITY_A as Parity}; | 27 | pub use pac::uarte0::{baudrate::BAUDRATE_A as Baudrate, config::PARITY_A as Parity}; |
diff --git a/embassy-nrf/src/gpiote.rs b/embassy-nrf/src/gpiote.rs index cf49b0db0..b52035705 100644 --- a/embassy-nrf/src/gpiote.rs +++ b/embassy-nrf/src/gpiote.rs | |||
| @@ -3,7 +3,7 @@ use core::future::Future; | |||
| 3 | use core::task::{Context, Poll}; | 3 | use core::task::{Context, Poll}; |
| 4 | 4 | ||
| 5 | use embassy_hal_common::{impl_peripheral, Peripheral, PeripheralRef}; | 5 | use embassy_hal_common::{impl_peripheral, Peripheral, PeripheralRef}; |
| 6 | use embassy_util::waitqueue::AtomicWaker; | 6 | use embassy_sync::waitqueue::AtomicWaker; |
| 7 | use futures::future::poll_fn; | 7 | use futures::future::poll_fn; |
| 8 | 8 | ||
| 9 | use crate::gpio::sealed::Pin as _; | 9 | use crate::gpio::sealed::Pin as _; |
diff --git a/embassy-nrf/src/qdec.rs b/embassy-nrf/src/qdec.rs index 83f2916b9..762e09715 100644 --- a/embassy-nrf/src/qdec.rs +++ b/embassy-nrf/src/qdec.rs | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | use core::task::Poll; | 3 | use core::task::Poll; |
| 4 | 4 | ||
| 5 | use embassy_hal_common::{into_ref, PeripheralRef}; | 5 | use embassy_hal_common::{into_ref, PeripheralRef}; |
| 6 | use embassy_util::waitqueue::AtomicWaker; | 6 | use embassy_sync::waitqueue::AtomicWaker; |
| 7 | use futures::future::poll_fn; | 7 | use futures::future::poll_fn; |
| 8 | 8 | ||
| 9 | use crate::gpio::sealed::Pin as _; | 9 | use crate::gpio::sealed::Pin as _; |
diff --git a/embassy-nrf/src/qspi.rs b/embassy-nrf/src/qspi.rs index 6d7ebb4b1..c97cb1656 100644 --- a/embassy-nrf/src/qspi.rs +++ b/embassy-nrf/src/qspi.rs | |||
| @@ -526,7 +526,7 @@ cfg_if::cfg_if! { | |||
| 526 | } | 526 | } |
| 527 | 527 | ||
| 528 | pub(crate) mod sealed { | 528 | pub(crate) mod sealed { |
| 529 | use embassy_util::waitqueue::AtomicWaker; | 529 | use embassy_sync::waitqueue::AtomicWaker; |
| 530 | 530 | ||
| 531 | use super::*; | 531 | use super::*; |
| 532 | 532 | ||
diff --git a/embassy-nrf/src/rng.rs b/embassy-nrf/src/rng.rs index 7aad561b6..42da51d0f 100644 --- a/embassy-nrf/src/rng.rs +++ b/embassy-nrf/src/rng.rs | |||
| @@ -4,7 +4,7 @@ use core::task::Poll; | |||
| 4 | 4 | ||
| 5 | use embassy_hal_common::drop::OnDrop; | 5 | use embassy_hal_common::drop::OnDrop; |
| 6 | use embassy_hal_common::{into_ref, PeripheralRef}; | 6 | use embassy_hal_common::{into_ref, PeripheralRef}; |
| 7 | use embassy_util::waitqueue::AtomicWaker; | 7 | use embassy_sync::waitqueue::AtomicWaker; |
| 8 | use futures::future::poll_fn; | 8 | use futures::future::poll_fn; |
| 9 | 9 | ||
| 10 | use crate::interrupt::InterruptExt; | 10 | use crate::interrupt::InterruptExt; |
diff --git a/embassy-nrf/src/saadc.rs b/embassy-nrf/src/saadc.rs index f2ef46d8d..7dc66349e 100644 --- a/embassy-nrf/src/saadc.rs +++ b/embassy-nrf/src/saadc.rs | |||
| @@ -4,7 +4,7 @@ use core::sync::atomic::{compiler_fence, Ordering}; | |||
| 4 | use core::task::Poll; | 4 | use core::task::Poll; |
| 5 | 5 | ||
| 6 | use embassy_hal_common::{impl_peripheral, into_ref, PeripheralRef}; | 6 | use embassy_hal_common::{impl_peripheral, into_ref, PeripheralRef}; |
| 7 | use embassy_util::waitqueue::AtomicWaker; | 7 | use embassy_sync::waitqueue::AtomicWaker; |
| 8 | use futures::future::poll_fn; | 8 | use futures::future::poll_fn; |
| 9 | use pac::{saadc, SAADC}; | 9 | use pac::{saadc, SAADC}; |
| 10 | use saadc::ch::config::{GAIN_A, REFSEL_A, RESP_A, TACQ_A}; | 10 | use 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 57c0c14c7..be2fc02fc 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 | ||
| 365 | pub(crate) mod sealed { | 365 | pub(crate) mod sealed { |
| 366 | use embassy_util::waitqueue::AtomicWaker; | 366 | use embassy_sync::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 1491e4268..d520fd686 100644 --- a/embassy-nrf/src/temp.rs +++ b/embassy-nrf/src/temp.rs | |||
| @@ -4,7 +4,7 @@ use core::task::Poll; | |||
| 4 | 4 | ||
| 5 | use embassy_hal_common::drop::OnDrop; | 5 | use embassy_hal_common::drop::OnDrop; |
| 6 | use embassy_hal_common::{into_ref, PeripheralRef}; | 6 | use embassy_hal_common::{into_ref, PeripheralRef}; |
| 7 | use embassy_util::waitqueue::AtomicWaker; | 7 | use embassy_sync::waitqueue::AtomicWaker; |
| 8 | use fixed::types::I30F2; | 8 | use fixed::types::I30F2; |
| 9 | use futures::future::poll_fn; | 9 | use futures::future::poll_fn; |
| 10 | 10 | ||
diff --git a/embassy-nrf/src/time_driver.rs b/embassy-nrf/src/time_driver.rs index b961d65a0..c32a44637 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}; | |||
| 3 | use core::{mem, ptr}; | 3 | use core::{mem, ptr}; |
| 4 | 4 | ||
| 5 | use critical_section::CriticalSection; | 5 | use critical_section::CriticalSection; |
| 6 | use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex; | ||
| 7 | use embassy_sync::blocking_mutex::CriticalSectionMutex as Mutex; | ||
| 6 | use embassy_time::driver::{AlarmHandle, Driver}; | 8 | use embassy_time::driver::{AlarmHandle, Driver}; |
| 7 | use embassy_util::blocking_mutex::raw::CriticalSectionRawMutex; | ||
| 8 | use embassy_util::blocking_mutex::CriticalSectionMutex as Mutex; | ||
| 9 | 9 | ||
| 10 | use crate::interrupt::{Interrupt, InterruptExt}; | 10 | use crate::interrupt::{Interrupt, InterruptExt}; |
| 11 | use crate::{interrupt, pac}; | 11 | use crate::{interrupt, pac}; |
diff --git a/embassy-nrf/src/timer.rs b/embassy-nrf/src/timer.rs index b3b613db2..3de5a8962 100644 --- a/embassy-nrf/src/timer.rs +++ b/embassy-nrf/src/timer.rs | |||
| @@ -5,7 +5,7 @@ use core::task::Poll; | |||
| 5 | 5 | ||
| 6 | use embassy_hal_common::drop::OnDrop; | 6 | use embassy_hal_common::drop::OnDrop; |
| 7 | use embassy_hal_common::{into_ref, PeripheralRef}; | 7 | use embassy_hal_common::{into_ref, PeripheralRef}; |
| 8 | use embassy_util::waitqueue::AtomicWaker; | 8 | use embassy_sync::waitqueue::AtomicWaker; |
| 9 | use futures::future::poll_fn; | 9 | use futures::future::poll_fn; |
| 10 | 10 | ||
| 11 | use crate::interrupt::{Interrupt, InterruptExt}; | 11 | use 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_util::waitqueue::AtomicWaker { | 43 | fn waker(n: usize) -> &'static ::embassy_sync::waitqueue::AtomicWaker { |
| 44 | use ::embassy_util::waitqueue::AtomicWaker; | 44 | use ::embassy_sync::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 9587d1f40..850f6d0fa 100644 --- a/embassy-nrf/src/twim.rs +++ b/embassy-nrf/src/twim.rs | |||
| @@ -13,9 +13,9 @@ use core::task::Poll; | |||
| 13 | 13 | ||
| 14 | use embassy_embedded_hal::SetConfig; | 14 | use embassy_embedded_hal::SetConfig; |
| 15 | use embassy_hal_common::{into_ref, PeripheralRef}; | 15 | use embassy_hal_common::{into_ref, PeripheralRef}; |
| 16 | use embassy_sync::waitqueue::AtomicWaker; | ||
| 16 | #[cfg(feature = "time")] | 17 | #[cfg(feature = "time")] |
| 17 | use embassy_time::{Duration, Instant}; | 18 | use embassy_time::{Duration, Instant}; |
| 18 | use embassy_util::waitqueue::AtomicWaker; | ||
| 19 | use futures::future::poll_fn; | 19 | use futures::future::poll_fn; |
| 20 | 20 | ||
| 21 | use crate::chip::{EASY_DMA_SIZE, FORCE_COPY_BUFFER_SIZE}; | 21 | use crate::chip::{EASY_DMA_SIZE, FORCE_COPY_BUFFER_SIZE}; |
diff --git a/embassy-nrf/src/uarte.rs b/embassy-nrf/src/uarte.rs index 0d24cf65f..4347ea558 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> { | |||
| 932 | pub(crate) mod sealed { | 932 | pub(crate) mod sealed { |
| 933 | use core::sync::atomic::AtomicU8; | 933 | use core::sync::atomic::AtomicU8; |
| 934 | 934 | ||
| 935 | use embassy_util::waitqueue::AtomicWaker; | 935 | use embassy_sync::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 509ee313e..688326e9c 100644 --- a/embassy-nrf/src/usb.rs +++ b/embassy-nrf/src/usb.rs | |||
| @@ -7,10 +7,10 @@ use core::task::Poll; | |||
| 7 | 7 | ||
| 8 | use cortex_m::peripheral::NVIC; | 8 | use cortex_m::peripheral::NVIC; |
| 9 | use embassy_hal_common::{into_ref, PeripheralRef}; | 9 | use embassy_hal_common::{into_ref, PeripheralRef}; |
| 10 | use embassy_sync::waitqueue::AtomicWaker; | ||
| 10 | pub use embassy_usb; | 11 | pub use embassy_usb; |
| 11 | use embassy_usb::driver::{self, EndpointError, Event, Unsupported}; | 12 | use embassy_usb::driver::{self, EndpointError, Event, Unsupported}; |
| 12 | use embassy_usb::types::{EndpointAddress, EndpointInfo, EndpointType, UsbDirection}; | 13 | use embassy_usb::types::{EndpointAddress, EndpointInfo, EndpointType, UsbDirection}; |
| 13 | use embassy_util::waitqueue::AtomicWaker; | ||
| 14 | use futures::future::poll_fn; | 14 | use futures::future::poll_fn; |
| 15 | use futures::Future; | 15 | use futures::Future; |
| 16 | use pac::usbd::RegisterBlock; | 16 | use pac::usbd::RegisterBlock; |
diff --git a/embassy-rp/Cargo.toml b/embassy-rp/Cargo.toml index 0e53d3a35..cfd95b7b4 100644 --- a/embassy-rp/Cargo.toml +++ b/embassy-rp/Cargo.toml | |||
| @@ -27,7 +27,7 @@ nightly = ["embassy-executor/nightly", "embedded-hal-1", "embedded-hal-async", " | |||
| 27 | unstable-traits = ["embedded-hal-1"] | 27 | unstable-traits = ["embedded-hal-1"] |
| 28 | 28 | ||
| 29 | [dependencies] | 29 | [dependencies] |
| 30 | embassy-util = { version = "0.1.0", path = "../embassy-util" } | 30 | embassy-sync = { version = "0.1.0", path = "../embassy-sync" } |
| 31 | embassy-executor = { version = "0.1.0", path = "../embassy-executor" } | 31 | embassy-executor = { version = "0.1.0", path = "../embassy-executor" } |
| 32 | embassy-time = { version = "0.1.0", path = "../embassy-time", features = [ "tick-1mhz" ] } | 32 | embassy-time = { version = "0.1.0", path = "../embassy-time", features = [ "tick-1mhz" ] } |
| 33 | embassy-cortex-m = { version = "0.1.0", path = "../embassy-cortex-m", features = ["prio-bits-2"]} | 33 | embassy-cortex-m = { version = "0.1.0", path = "../embassy-cortex-m", features = ["prio-bits-2"]} |
diff --git a/embassy-rp/src/gpio.rs b/embassy-rp/src/gpio.rs index 90862fa32..428855c7f 100644 --- a/embassy-rp/src/gpio.rs +++ b/embassy-rp/src/gpio.rs | |||
| @@ -5,7 +5,7 @@ use core::task::{Context, Poll}; | |||
| 5 | 5 | ||
| 6 | use embassy_cortex_m::interrupt::{Interrupt, InterruptExt}; | 6 | use embassy_cortex_m::interrupt::{Interrupt, InterruptExt}; |
| 7 | use embassy_hal_common::{impl_peripheral, into_ref, PeripheralRef}; | 7 | use embassy_hal_common::{impl_peripheral, into_ref, PeripheralRef}; |
| 8 | use embassy_util::waitqueue::AtomicWaker; | 8 | use embassy_sync::waitqueue::AtomicWaker; |
| 9 | 9 | ||
| 10 | use crate::pac::common::{Reg, RW}; | 10 | use crate::pac::common::{Reg, RW}; |
| 11 | use crate::pac::SIO; | 11 | use crate::pac::SIO; |
diff --git a/embassy-rp/src/timer.rs b/embassy-rp/src/timer.rs index 5bc1f66c8..5215c0c0f 100644 --- a/embassy-rp/src/timer.rs +++ b/embassy-rp/src/timer.rs | |||
| @@ -2,9 +2,9 @@ use core::cell::Cell; | |||
| 2 | 2 | ||
| 3 | use atomic_polyfill::{AtomicU8, Ordering}; | 3 | use atomic_polyfill::{AtomicU8, Ordering}; |
| 4 | use critical_section::CriticalSection; | 4 | use critical_section::CriticalSection; |
| 5 | use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex; | ||
| 6 | use embassy_sync::blocking_mutex::Mutex; | ||
| 5 | use embassy_time::driver::{AlarmHandle, Driver}; | 7 | use embassy_time::driver::{AlarmHandle, Driver}; |
| 6 | use embassy_util::blocking_mutex::raw::CriticalSectionRawMutex; | ||
| 7 | use embassy_util::blocking_mutex::Mutex; | ||
| 8 | 8 | ||
| 9 | use crate::interrupt::{Interrupt, InterruptExt}; | 9 | use crate::interrupt::{Interrupt, InterruptExt}; |
| 10 | use crate::{interrupt, pac}; | 10 | use crate::{interrupt, pac}; |
diff --git a/embassy-stm32/Cargo.toml b/embassy-stm32/Cargo.toml index c47ea0bca..7a8e5c59b 100644 --- a/embassy-stm32/Cargo.toml +++ b/embassy-stm32/Cargo.toml | |||
| @@ -31,7 +31,7 @@ flavors = [ | |||
| 31 | ] | 31 | ] |
| 32 | 32 | ||
| 33 | [dependencies] | 33 | [dependencies] |
| 34 | embassy-util = { version = "0.1.0", path = "../embassy-util" } | 34 | embassy-sync = { version = "0.1.0", path = "../embassy-sync" } |
| 35 | embassy-executor = { version = "0.1.0", path = "../embassy-executor" } | 35 | embassy-executor = { version = "0.1.0", path = "../embassy-executor" } |
| 36 | embassy-time = { version = "0.1.0", path = "../embassy-time", optional = true } | 36 | embassy-time = { version = "0.1.0", path = "../embassy-time", optional = true } |
| 37 | embassy-cortex-m = { version = "0.1.0", path = "../embassy-cortex-m", features = ["prio-bits-4"]} | 37 | embassy-cortex-m = { version = "0.1.0", path = "../embassy-cortex-m", features = ["prio-bits-4"]} |
| @@ -72,7 +72,7 @@ quote = "1.0.15" | |||
| 72 | stm32-metapac = { version = "0.1.0", path = "../stm32-metapac", default-features = false, features = ["metadata"]} | 72 | stm32-metapac = { version = "0.1.0", path = "../stm32-metapac", default-features = false, features = ["metadata"]} |
| 73 | 73 | ||
| 74 | [features] | 74 | [features] |
| 75 | defmt = ["dep:defmt", "bxcan/unstable-defmt", "embassy-util/defmt", "embassy-executor/defmt", "embassy-embedded-hal/defmt", "embedded-io?/defmt", "embassy-usb?/defmt"] | 75 | defmt = ["dep:defmt", "bxcan/unstable-defmt", "embassy-sync/defmt", "embassy-executor/defmt", "embassy-embedded-hal/defmt", "embedded-io?/defmt", "embassy-usb?/defmt"] |
| 76 | sdmmc-rs = ["embedded-sdmmc"] | 76 | sdmmc-rs = ["embedded-sdmmc"] |
| 77 | net = ["embassy-net" ] | 77 | net = ["embassy-net" ] |
| 78 | memory-x = ["stm32-metapac/memory-x"] | 78 | memory-x = ["stm32-metapac/memory-x"] |
diff --git a/embassy-stm32/src/dcmi.rs b/embassy-stm32/src/dcmi.rs index bbb9a12cb..fb9dc9d08 100644 --- a/embassy-stm32/src/dcmi.rs +++ b/embassy-stm32/src/dcmi.rs | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | use core::task::Poll; | 1 | use core::task::Poll; |
| 2 | 2 | ||
| 3 | use embassy_hal_common::{into_ref, PeripheralRef}; | 3 | use embassy_hal_common::{into_ref, PeripheralRef}; |
| 4 | use embassy_util::waitqueue::AtomicWaker; | 4 | use embassy_sync::waitqueue::AtomicWaker; |
| 5 | use futures::future::poll_fn; | 5 | use futures::future::poll_fn; |
| 6 | 6 | ||
| 7 | use crate::gpio::sealed::AFType; | 7 | use crate::gpio::sealed::AFType; |
diff --git a/embassy-stm32/src/dma/bdma.rs b/embassy-stm32/src/dma/bdma.rs index bd2cd5b57..674255ddc 100644 --- a/embassy-stm32/src/dma/bdma.rs +++ b/embassy-stm32/src/dma/bdma.rs | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | use core::sync::atomic::{fence, Ordering}; | 3 | use core::sync::atomic::{fence, Ordering}; |
| 4 | use core::task::Waker; | 4 | use core::task::Waker; |
| 5 | 5 | ||
| 6 | use embassy_util::waitqueue::AtomicWaker; | 6 | use embassy_sync::waitqueue::AtomicWaker; |
| 7 | 7 | ||
| 8 | use super::{TransferOptions, Word, WordSize}; | 8 | use super::{TransferOptions, Word, WordSize}; |
| 9 | use crate::_generated::BDMA_CHANNEL_COUNT; | 9 | use crate::_generated::BDMA_CHANNEL_COUNT; |
diff --git a/embassy-stm32/src/dma/dma.rs b/embassy-stm32/src/dma/dma.rs index 0c66005c7..a45b8780b 100644 --- a/embassy-stm32/src/dma/dma.rs +++ b/embassy-stm32/src/dma/dma.rs | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | use core::sync::atomic::{fence, Ordering}; | 1 | use core::sync::atomic::{fence, Ordering}; |
| 2 | use core::task::Waker; | 2 | use core::task::Waker; |
| 3 | 3 | ||
| 4 | use embassy_util::waitqueue::AtomicWaker; | 4 | use embassy_sync::waitqueue::AtomicWaker; |
| 5 | 5 | ||
| 6 | use super::{Burst, FlowControl, Request, TransferOptions, Word, WordSize}; | 6 | use super::{Burst, FlowControl, Request, TransferOptions, Word, WordSize}; |
| 7 | use crate::_generated::DMA_CHANNEL_COUNT; | 7 | use crate::_generated::DMA_CHANNEL_COUNT; |
diff --git a/embassy-stm32/src/dma/gpdma.rs b/embassy-stm32/src/dma/gpdma.rs index 1aea6c65d..bde8c3ef3 100644 --- a/embassy-stm32/src/dma/gpdma.rs +++ b/embassy-stm32/src/dma/gpdma.rs | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | use core::sync::atomic::{fence, Ordering}; | 1 | use core::sync::atomic::{fence, Ordering}; |
| 2 | use core::task::Waker; | 2 | use core::task::Waker; |
| 3 | 3 | ||
| 4 | use embassy_util::waitqueue::AtomicWaker; | 4 | use embassy_sync::waitqueue::AtomicWaker; |
| 5 | 5 | ||
| 6 | use super::{Request, TransferOptions, Word, WordSize}; | 6 | use super::{Request, TransferOptions, Word, WordSize}; |
| 7 | use crate::_generated::GPDMA_CHANNEL_COUNT; | 7 | use crate::_generated::GPDMA_CHANNEL_COUNT; |
diff --git a/embassy-stm32/src/eth/v1/mod.rs b/embassy-stm32/src/eth/v1/mod.rs index 37593914f..1ab0438ad 100644 --- a/embassy-stm32/src/eth/v1/mod.rs +++ b/embassy-stm32/src/eth/v1/mod.rs | |||
| @@ -7,7 +7,7 @@ use core::task::Waker; | |||
| 7 | use embassy_cortex_m::peripheral::{PeripheralMutex, PeripheralState, StateStorage}; | 7 | use embassy_cortex_m::peripheral::{PeripheralMutex, PeripheralState, StateStorage}; |
| 8 | use embassy_hal_common::{into_ref, PeripheralRef}; | 8 | use embassy_hal_common::{into_ref, PeripheralRef}; |
| 9 | use embassy_net::{Device, DeviceCapabilities, LinkState, PacketBuf, MTU}; | 9 | use embassy_net::{Device, DeviceCapabilities, LinkState, PacketBuf, MTU}; |
| 10 | use embassy_util::waitqueue::AtomicWaker; | 10 | use embassy_sync::waitqueue::AtomicWaker; |
| 11 | 11 | ||
| 12 | use crate::gpio::sealed::{AFType, Pin as __GpioPin}; | 12 | use crate::gpio::sealed::{AFType, Pin as __GpioPin}; |
| 13 | use crate::gpio::{AnyPin, Speed}; | 13 | use crate::gpio::{AnyPin, Speed}; |
diff --git a/embassy-stm32/src/eth/v2/mod.rs b/embassy-stm32/src/eth/v2/mod.rs index 1bc1fb72e..d67c3c5e4 100644 --- a/embassy-stm32/src/eth/v2/mod.rs +++ b/embassy-stm32/src/eth/v2/mod.rs | |||
| @@ -5,7 +5,7 @@ use core::task::Waker; | |||
| 5 | use embassy_cortex_m::peripheral::{PeripheralMutex, PeripheralState, StateStorage}; | 5 | use embassy_cortex_m::peripheral::{PeripheralMutex, PeripheralState, StateStorage}; |
| 6 | use embassy_hal_common::{into_ref, PeripheralRef}; | 6 | use embassy_hal_common::{into_ref, PeripheralRef}; |
| 7 | use embassy_net::{Device, DeviceCapabilities, LinkState, PacketBuf, MTU}; | 7 | use embassy_net::{Device, DeviceCapabilities, LinkState, PacketBuf, MTU}; |
| 8 | use embassy_util::waitqueue::AtomicWaker; | 8 | use embassy_sync::waitqueue::AtomicWaker; |
| 9 | 9 | ||
| 10 | use crate::gpio::sealed::{AFType, Pin as _}; | 10 | use crate::gpio::sealed::{AFType, Pin as _}; |
| 11 | use crate::gpio::{AnyPin, Speed}; | 11 | use crate::gpio::{AnyPin, Speed}; |
diff --git a/embassy-stm32/src/exti.rs b/embassy-stm32/src/exti.rs index ecb180bbe..935149b13 100644 --- a/embassy-stm32/src/exti.rs +++ b/embassy-stm32/src/exti.rs | |||
| @@ -4,7 +4,7 @@ use core::pin::Pin; | |||
| 4 | use core::task::{Context, Poll}; | 4 | use core::task::{Context, Poll}; |
| 5 | 5 | ||
| 6 | use embassy_hal_common::impl_peripheral; | 6 | use embassy_hal_common::impl_peripheral; |
| 7 | use embassy_util::waitqueue::AtomicWaker; | 7 | use embassy_sync::waitqueue::AtomicWaker; |
| 8 | 8 | ||
| 9 | use crate::gpio::{AnyPin, Input, Pin as GpioPin}; | 9 | use crate::gpio::{AnyPin, Input, Pin as GpioPin}; |
| 10 | use crate::pac::exti::regs::Lines; | 10 | use crate::pac::exti::regs::Lines; |
diff --git a/embassy-stm32/src/i2c/v2.rs b/embassy-stm32/src/i2c/v2.rs index b4303d3d4..07a3105da 100644 --- a/embassy-stm32/src/i2c/v2.rs +++ b/embassy-stm32/src/i2c/v2.rs | |||
| @@ -5,7 +5,7 @@ use atomic_polyfill::{AtomicUsize, Ordering}; | |||
| 5 | use embassy_embedded_hal::SetConfig; | 5 | use embassy_embedded_hal::SetConfig; |
| 6 | use embassy_hal_common::drop::OnDrop; | 6 | use embassy_hal_common::drop::OnDrop; |
| 7 | use embassy_hal_common::{into_ref, PeripheralRef}; | 7 | use embassy_hal_common::{into_ref, PeripheralRef}; |
| 8 | use embassy_util::waitqueue::AtomicWaker; | 8 | use embassy_sync::waitqueue::AtomicWaker; |
| 9 | use futures::future::poll_fn; | 9 | use futures::future::poll_fn; |
| 10 | 10 | ||
| 11 | use crate::dma::NoDma; | 11 | use crate::dma::NoDma; |
diff --git a/embassy-stm32/src/rng.rs b/embassy-stm32/src/rng.rs index 81e28f355..520f2ab9a 100644 --- a/embassy-stm32/src/rng.rs +++ b/embassy-stm32/src/rng.rs | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | use core::task::Poll; | 3 | use core::task::Poll; |
| 4 | 4 | ||
| 5 | use embassy_hal_common::{into_ref, PeripheralRef}; | 5 | use embassy_hal_common::{into_ref, PeripheralRef}; |
| 6 | use embassy_util::waitqueue::AtomicWaker; | 6 | use embassy_sync::waitqueue::AtomicWaker; |
| 7 | use futures::future::poll_fn; | 7 | use futures::future::poll_fn; |
| 8 | use rand_core::{CryptoRng, RngCore}; | 8 | use rand_core::{CryptoRng, RngCore}; |
| 9 | 9 | ||
diff --git a/embassy-stm32/src/sdmmc/mod.rs b/embassy-stm32/src/sdmmc/mod.rs index 3ad31ec87..67758c492 100644 --- a/embassy-stm32/src/sdmmc/mod.rs +++ b/embassy-stm32/src/sdmmc/mod.rs | |||
| @@ -5,7 +5,7 @@ use core::task::Poll; | |||
| 5 | 5 | ||
| 6 | use embassy_hal_common::drop::OnDrop; | 6 | use embassy_hal_common::drop::OnDrop; |
| 7 | use embassy_hal_common::{into_ref, PeripheralRef}; | 7 | use embassy_hal_common::{into_ref, PeripheralRef}; |
| 8 | use embassy_util::waitqueue::AtomicWaker; | 8 | use embassy_sync::waitqueue::AtomicWaker; |
| 9 | use futures::future::poll_fn; | 9 | use futures::future::poll_fn; |
| 10 | use sdio_host::{BusWidth, CardCapacity, CardStatus, CurrentState, SDStatus, CID, CSD, OCR, SCR}; | 10 | use sdio_host::{BusWidth, CardCapacity, CardStatus, CurrentState, SDStatus, CID, CSD, OCR, SCR}; |
| 11 | 11 | ||
| @@ -1514,8 +1514,8 @@ foreach_peripheral!( | |||
| 1514 | INNER | 1514 | INNER |
| 1515 | } | 1515 | } |
| 1516 | 1516 | ||
| 1517 | fn state() -> &'static ::embassy_util::waitqueue::AtomicWaker { | 1517 | fn state() -> &'static ::embassy_sync::waitqueue::AtomicWaker { |
| 1518 | static WAKER: ::embassy_util::waitqueue::AtomicWaker = ::embassy_util::waitqueue::AtomicWaker::new(); | 1518 | static WAKER: ::embassy_sync::waitqueue::AtomicWaker = ::embassy_sync::waitqueue::AtomicWaker::new(); |
| 1519 | &WAKER | 1519 | &WAKER |
| 1520 | } | 1520 | } |
| 1521 | } | 1521 | } |
diff --git a/embassy-stm32/src/time_driver.rs b/embassy-stm32/src/time_driver.rs index 7f4723162..6989a43d3 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}; | |||
| 4 | use core::{mem, ptr}; | 4 | use core::{mem, ptr}; |
| 5 | 5 | ||
| 6 | use atomic_polyfill::{AtomicU32, AtomicU8}; | 6 | use atomic_polyfill::{AtomicU32, AtomicU8}; |
| 7 | use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex; | ||
| 8 | use embassy_sync::blocking_mutex::Mutex; | ||
| 7 | use embassy_time::driver::{AlarmHandle, Driver}; | 9 | use embassy_time::driver::{AlarmHandle, Driver}; |
| 8 | use embassy_time::TICKS_PER_SECOND; | 10 | use embassy_time::TICKS_PER_SECOND; |
| 9 | use embassy_util::blocking_mutex::raw::CriticalSectionRawMutex; | ||
| 10 | use embassy_util::blocking_mutex::Mutex; | ||
| 11 | use stm32_metapac::timer::regs; | 11 | use stm32_metapac::timer::regs; |
| 12 | 12 | ||
| 13 | use crate::interrupt::{CriticalSection, InterruptExt}; | 13 | use crate::interrupt::{CriticalSection, InterruptExt}; |
diff --git a/embassy-stm32/src/usart/buffered.rs b/embassy-stm32/src/usart/buffered.rs index ec2231e43..a7fa43894 100644 --- a/embassy-stm32/src/usart/buffered.rs +++ b/embassy-stm32/src/usart/buffered.rs | |||
| @@ -4,7 +4,7 @@ use core::task::Poll; | |||
| 4 | use atomic_polyfill::{compiler_fence, Ordering}; | 4 | use atomic_polyfill::{compiler_fence, Ordering}; |
| 5 | use embassy_cortex_m::peripheral::{PeripheralMutex, PeripheralState, StateStorage}; | 5 | use embassy_cortex_m::peripheral::{PeripheralMutex, PeripheralState, StateStorage}; |
| 6 | use embassy_hal_common::ring_buffer::RingBuffer; | 6 | use embassy_hal_common::ring_buffer::RingBuffer; |
| 7 | use embassy_util::waitqueue::WakerRegistration; | 7 | use embassy_sync::waitqueue::WakerRegistration; |
| 8 | use futures::future::poll_fn; | 8 | use futures::future::poll_fn; |
| 9 | 9 | ||
| 10 | use super::*; | 10 | use super::*; |
diff --git a/embassy-stm32/src/usb/usb.rs b/embassy-stm32/src/usb/usb.rs index 3861e42d0..db965824a 100644 --- a/embassy-stm32/src/usb/usb.rs +++ b/embassy-stm32/src/usb/usb.rs | |||
| @@ -6,10 +6,10 @@ use core::task::Poll; | |||
| 6 | 6 | ||
| 7 | use atomic_polyfill::{AtomicBool, AtomicU8}; | 7 | use atomic_polyfill::{AtomicBool, AtomicU8}; |
| 8 | use embassy_hal_common::into_ref; | 8 | use embassy_hal_common::into_ref; |
| 9 | use embassy_sync::waitqueue::AtomicWaker; | ||
| 9 | use embassy_time::{block_for, Duration}; | 10 | use embassy_time::{block_for, Duration}; |
| 10 | use embassy_usb::driver::{self, EndpointAllocError, EndpointError, Event, Unsupported}; | 11 | use embassy_usb::driver::{self, EndpointAllocError, EndpointError, Event, Unsupported}; |
| 11 | use embassy_usb::types::{EndpointAddress, EndpointInfo, EndpointType, UsbDirection}; | 12 | use embassy_usb::types::{EndpointAddress, EndpointInfo, EndpointType, UsbDirection}; |
| 12 | use embassy_util::waitqueue::AtomicWaker; | ||
| 13 | use futures::future::poll_fn; | 13 | use futures::future::poll_fn; |
| 14 | use futures::Future; | 14 | use futures::Future; |
| 15 | use pac::common::{Reg, RW}; | 15 | use pac::common::{Reg, RW}; |
diff --git a/embassy-util/Cargo.toml b/embassy-sync/Cargo.toml index b54a58b46..0d14bba55 100644 --- a/embassy-util/Cargo.toml +++ b/embassy-sync/Cargo.toml | |||
| @@ -1,11 +1,11 @@ | |||
| 1 | [package] | 1 | [package] |
| 2 | name = "embassy-util" | 2 | name = "embassy-sync" |
| 3 | version = "0.1.0" | 3 | version = "0.1.0" |
| 4 | edition = "2021" | 4 | edition = "2021" |
| 5 | 5 | ||
| 6 | [package.metadata.embassy_docs] | 6 | [package.metadata.embassy_docs] |
| 7 | src_base = "https://github.com/embassy-rs/embassy/blob/embassy-util-v$VERSION/embassy-util/src/" | 7 | src_base = "https://github.com/embassy-rs/embassy/blob/embassy-sync-v$VERSION/embassy-sync/src/" |
| 8 | src_base_git = "https://github.com/embassy-rs/embassy/blob/$COMMIT/embassy-util/src/" | 8 | src_base_git = "https://github.com/embassy-rs/embassy/blob/$COMMIT/embassy-sync/src/" |
| 9 | features = ["nightly"] | 9 | features = ["nightly"] |
| 10 | target = "thumbv7em-none-eabi" | 10 | target = "thumbv7em-none-eabi" |
| 11 | 11 | ||
diff --git a/embassy-util/build.rs b/embassy-sync/build.rs index 6fe82b44f..6fe82b44f 100644 --- a/embassy-util/build.rs +++ b/embassy-sync/build.rs | |||
diff --git a/embassy-util/src/blocking_mutex/mod.rs b/embassy-sync/src/blocking_mutex/mod.rs index 8a4a4c642..8a4a4c642 100644 --- a/embassy-util/src/blocking_mutex/mod.rs +++ b/embassy-sync/src/blocking_mutex/mod.rs | |||
diff --git a/embassy-util/src/blocking_mutex/raw.rs b/embassy-sync/src/blocking_mutex/raw.rs index 15796f1b2..15796f1b2 100644 --- a/embassy-util/src/blocking_mutex/raw.rs +++ b/embassy-sync/src/blocking_mutex/raw.rs | |||
diff --git a/embassy-util/src/channel/mod.rs b/embassy-sync/src/channel/mod.rs index 5df1f5c5c..5df1f5c5c 100644 --- a/embassy-util/src/channel/mod.rs +++ b/embassy-sync/src/channel/mod.rs | |||
diff --git a/embassy-util/src/channel/mpmc.rs b/embassy-sync/src/channel/mpmc.rs index 263f29bfc..7bebd3412 100644 --- a/embassy-util/src/channel/mpmc.rs +++ b/embassy-sync/src/channel/mpmc.rs | |||
| @@ -373,8 +373,8 @@ 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_util::channel::mpmc::Channel; | 376 | /// use embassy_sync::channel::mpmc::Channel; |
| 377 | /// use embassy_util::blocking_mutex::raw::NoopRawMutex; | 377 | /// use embassy_sync::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(); |
diff --git a/embassy-util/src/channel/pubsub/mod.rs b/embassy-sync/src/channel/pubsub/mod.rs index ecc8fbd8f..f62b4d118 100644 --- a/embassy-util/src/channel/pubsub/mod.rs +++ b/embassy-sync/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_util::blocking_mutex::raw::NoopRawMutex; | 36 | /// # use embassy_sync::blocking_mutex::raw::NoopRawMutex; |
| 37 | /// # use embassy_util::channel::pubsub::WaitResult; | 37 | /// # use embassy_sync::channel::pubsub::WaitResult; |
| 38 | /// # use embassy_util::channel::pubsub::PubSubChannel; | 38 | /// # use embassy_sync::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-util/src/channel/pubsub/publisher.rs b/embassy-sync/src/channel/pubsub/publisher.rs index 705797f60..705797f60 100644 --- a/embassy-util/src/channel/pubsub/publisher.rs +++ b/embassy-sync/src/channel/pubsub/publisher.rs | |||
diff --git a/embassy-util/src/channel/pubsub/subscriber.rs b/embassy-sync/src/channel/pubsub/subscriber.rs index b9a2cbe18..b9a2cbe18 100644 --- a/embassy-util/src/channel/pubsub/subscriber.rs +++ b/embassy-sync/src/channel/pubsub/subscriber.rs | |||
diff --git a/embassy-util/src/channel/signal.rs b/embassy-sync/src/channel/signal.rs index 05889f5a4..9279266c1 100644 --- a/embassy-util/src/channel/signal.rs +++ b/embassy-sync/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_util::channel::signal::Signal; | 22 | /// use embassy_sync::channel::signal::Signal; |
| 23 | /// | 23 | /// |
| 24 | /// enum SomeCommand { | 24 | /// enum SomeCommand { |
| 25 | /// On, | 25 | /// On, |
diff --git a/embassy-sync/src/fmt.rs b/embassy-sync/src/fmt.rs new file mode 100644 index 000000000..f8bb0a035 --- /dev/null +++ b/embassy-sync/src/fmt.rs | |||
| @@ -0,0 +1,228 @@ | |||
| 1 | #![macro_use] | ||
| 2 | #![allow(unused_macros)] | ||
| 3 | |||
| 4 | #[cfg(all(feature = "defmt", feature = "log"))] | ||
| 5 | compile_error!("You may not enable both `defmt` and `log` features."); | ||
| 6 | |||
| 7 | macro_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 | |||
| 18 | macro_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 | |||
| 29 | macro_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 | |||
| 40 | macro_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 | |||
| 51 | macro_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 | |||
| 62 | macro_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 | |||
| 73 | macro_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 | |||
| 84 | macro_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 | |||
| 95 | macro_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 | |||
| 106 | macro_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 | |||
| 119 | macro_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 | |||
| 132 | macro_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 | |||
| 145 | macro_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 | |||
| 158 | macro_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")] | ||
| 172 | macro_rules! unwrap { | ||
| 173 | ($($x:tt)*) => { | ||
| 174 | ::defmt::unwrap!($($x)*) | ||
| 175 | }; | ||
| 176 | } | ||
| 177 | |||
| 178 | #[cfg(not(feature = "defmt"))] | ||
| 179 | macro_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")] | ||
| 199 | defmt::timestamp! {"{=u64:us}", crate::time::Instant::now().as_micros() } | ||
| 200 | |||
| 201 | #[derive(Debug, Copy, Clone, Eq, PartialEq)] | ||
| 202 | pub struct NoneError; | ||
| 203 | |||
| 204 | pub trait Try { | ||
| 205 | type Ok; | ||
| 206 | type Error; | ||
| 207 | fn into_result(self) -> Result<Self::Ok, Self::Error>; | ||
| 208 | } | ||
| 209 | |||
| 210 | impl<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 | |||
| 220 | impl<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-util/src/lib.rs b/embassy-sync/src/lib.rs index 8ec3300d9..7d8815903 100644 --- a/embassy-util/src/lib.rs +++ b/embassy-sync/src/lib.rs | |||
| @@ -15,9 +15,3 @@ pub mod channel; | |||
| 15 | pub mod mutex; | 15 | pub mod mutex; |
| 16 | pub mod pipe; | 16 | pub mod pipe; |
| 17 | pub mod waitqueue; | 17 | pub mod waitqueue; |
| 18 | |||
| 19 | mod select; | ||
| 20 | mod yield_now; | ||
| 21 | |||
| 22 | pub use select::*; | ||
| 23 | pub use yield_now::*; | ||
diff --git a/embassy-util/src/mutex.rs b/embassy-sync/src/mutex.rs index 75a6e8dd3..75a6e8dd3 100644 --- a/embassy-util/src/mutex.rs +++ b/embassy-sync/src/mutex.rs | |||
diff --git a/embassy-util/src/pipe.rs b/embassy-sync/src/pipe.rs index d85b843e4..7d64b648e 100644 --- a/embassy-util/src/pipe.rs +++ b/embassy-sync/src/pipe.rs | |||
| @@ -241,8 +241,8 @@ where | |||
| 241 | /// Establish a new bounded pipe. For example, to create one with a NoopMutex: | 241 | /// Establish a new bounded pipe. For example, to create one with a NoopMutex: |
| 242 | /// | 242 | /// |
| 243 | /// ``` | 243 | /// ``` |
| 244 | /// use embassy_util::pipe::Pipe; | 244 | /// use embassy_sync::pipe::Pipe; |
| 245 | /// use embassy_util::blocking_mutex::raw::NoopRawMutex; | 245 | /// use embassy_sync::blocking_mutex::raw::NoopRawMutex; |
| 246 | /// | 246 | /// |
| 247 | /// // Declare a bounded pipe, with a buffer of 256 bytes. | 247 | /// // Declare a bounded pipe, with a buffer of 256 bytes. |
| 248 | /// let mut pipe = Pipe::<NoopRawMutex, 256>::new(); | 248 | /// let mut pipe = Pipe::<NoopRawMutex, 256>::new(); |
diff --git a/embassy-util/src/ring_buffer.rs b/embassy-sync/src/ring_buffer.rs index 521084024..521084024 100644 --- a/embassy-util/src/ring_buffer.rs +++ b/embassy-sync/src/ring_buffer.rs | |||
diff --git a/embassy-util/src/waitqueue/mod.rs b/embassy-sync/src/waitqueue/mod.rs index 6661a6b61..6661a6b61 100644 --- a/embassy-util/src/waitqueue/mod.rs +++ b/embassy-sync/src/waitqueue/mod.rs | |||
diff --git a/embassy-util/src/waitqueue/multi_waker.rs b/embassy-sync/src/waitqueue/multi_waker.rs index 325d2cb3a..325d2cb3a 100644 --- a/embassy-util/src/waitqueue/multi_waker.rs +++ b/embassy-sync/src/waitqueue/multi_waker.rs | |||
diff --git a/embassy-util/src/waitqueue/waker.rs b/embassy-sync/src/waitqueue/waker.rs index 64e300eb8..64e300eb8 100644 --- a/embassy-util/src/waitqueue/waker.rs +++ b/embassy-sync/src/waitqueue/waker.rs | |||
diff --git a/embassy-usb-hid/Cargo.toml b/embassy-usb-hid/Cargo.toml index 5e9cfebf7..730351485 100644 --- a/embassy-usb-hid/Cargo.toml +++ b/embassy-usb-hid/Cargo.toml | |||
| @@ -14,7 +14,7 @@ default = ["usbd-hid"] | |||
| 14 | usbd-hid = ["dep:usbd-hid", "ssmarshal"] | 14 | usbd-hid = ["dep:usbd-hid", "ssmarshal"] |
| 15 | 15 | ||
| 16 | [dependencies] | 16 | [dependencies] |
| 17 | embassy-util = { version = "0.1.0", path = "../embassy-util" } | 17 | embassy-sync = { version = "0.1.0", path = "../embassy-sync" } |
| 18 | embassy-usb = { version = "0.1.0", path = "../embassy-usb" } | 18 | embassy-usb = { version = "0.1.0", path = "../embassy-usb" } |
| 19 | 19 | ||
| 20 | defmt = { version = "0.3", optional = true } | 20 | defmt = { version = "0.3", optional = true } |
diff --git a/embassy-usb-ncm/Cargo.toml b/embassy-usb-ncm/Cargo.toml index 47c1f36bd..15d3db96f 100644 --- a/embassy-usb-ncm/Cargo.toml +++ b/embassy-usb-ncm/Cargo.toml | |||
| @@ -10,7 +10,7 @@ features = ["defmt"] | |||
| 10 | target = "thumbv7em-none-eabi" | 10 | target = "thumbv7em-none-eabi" |
| 11 | 11 | ||
| 12 | [dependencies] | 12 | [dependencies] |
| 13 | embassy-util = { version = "0.1.0", path = "../embassy-util" } | 13 | embassy-sync = { version = "0.1.0", path = "../embassy-sync" } |
| 14 | embassy-usb = { version = "0.1.0", path = "../embassy-usb" } | 14 | embassy-usb = { version = "0.1.0", path = "../embassy-usb" } |
| 15 | 15 | ||
| 16 | defmt = { version = "0.3", optional = true } | 16 | defmt = { version = "0.3", optional = true } |
diff --git a/embassy-usb-serial/Cargo.toml b/embassy-usb-serial/Cargo.toml index 633610471..9788588e9 100644 --- a/embassy-usb-serial/Cargo.toml +++ b/embassy-usb-serial/Cargo.toml | |||
| @@ -10,7 +10,7 @@ features = ["defmt"] | |||
| 10 | target = "thumbv7em-none-eabi" | 10 | target = "thumbv7em-none-eabi" |
| 11 | 11 | ||
| 12 | [dependencies] | 12 | [dependencies] |
| 13 | embassy-util = { version = "0.1.0", path = "../embassy-util" } | 13 | embassy-sync = { version = "0.1.0", path = "../embassy-sync" } |
| 14 | embassy-usb = { version = "0.1.0", path = "../embassy-usb" } | 14 | embassy-usb = { version = "0.1.0", path = "../embassy-usb" } |
| 15 | 15 | ||
| 16 | defmt = { version = "0.3", optional = true } | 16 | defmt = { version = "0.3", optional = true } |
diff --git a/embassy-usb-serial/src/lib.rs b/embassy-usb-serial/src/lib.rs index e561be9df..f3de2ec1b 100644 --- a/embassy-usb-serial/src/lib.rs +++ b/embassy-usb-serial/src/lib.rs | |||
| @@ -9,11 +9,11 @@ use core::cell::Cell; | |||
| 9 | use core::mem::{self, MaybeUninit}; | 9 | use core::mem::{self, MaybeUninit}; |
| 10 | use core::sync::atomic::{AtomicBool, Ordering}; | 10 | use core::sync::atomic::{AtomicBool, Ordering}; |
| 11 | 11 | ||
| 12 | use embassy_sync::blocking_mutex::CriticalSectionMutex; | ||
| 12 | use embassy_usb::control::{self, ControlHandler, InResponse, OutResponse, Request}; | 13 | use embassy_usb::control::{self, ControlHandler, InResponse, OutResponse, Request}; |
| 13 | use embassy_usb::driver::{Driver, Endpoint, EndpointError, EndpointIn, EndpointOut}; | 14 | use embassy_usb::driver::{Driver, Endpoint, EndpointError, EndpointIn, EndpointOut}; |
| 14 | use embassy_usb::types::*; | 15 | use embassy_usb::types::*; |
| 15 | use embassy_usb::Builder; | 16 | use embassy_usb::Builder; |
| 16 | use 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`. |
| 19 | pub const USB_CLASS_CDC: u8 = 0x02; | 19 | pub const USB_CLASS_CDC: u8 = 0x02; |
diff --git a/embassy-usb/Cargo.toml b/embassy-usb/Cargo.toml index 6adbd399b..8cad4d314 100644 --- a/embassy-usb/Cargo.toml +++ b/embassy-usb/Cargo.toml | |||
| @@ -10,7 +10,7 @@ features = ["defmt"] | |||
| 10 | target = "thumbv7em-none-eabi" | 10 | target = "thumbv7em-none-eabi" |
| 11 | 11 | ||
| 12 | [dependencies] | 12 | [dependencies] |
| 13 | embassy-util = { version = "0.1.0", path = "../embassy-util" } | 13 | embassy-futures = { version = "0.1.0", path = "../embassy-futures" } |
| 14 | 14 | ||
| 15 | defmt = { version = "0.3", optional = true } | 15 | defmt = { version = "0.3", optional = true } |
| 16 | log = { version = "0.4.14", optional = true } | 16 | log = { version = "0.4.14", optional = true } |
diff --git a/embassy-usb/src/lib.rs b/embassy-usb/src/lib.rs index 3f6e13472..5a3f8ba88 100644 --- a/embassy-usb/src/lib.rs +++ b/embassy-usb/src/lib.rs | |||
| @@ -12,7 +12,7 @@ mod descriptor_reader; | |||
| 12 | pub mod driver; | 12 | pub mod driver; |
| 13 | pub mod types; | 13 | pub mod types; |
| 14 | 14 | ||
| 15 | use embassy_util::{select, Either}; | 15 | use embassy_futures::{select, Either}; |
| 16 | use heapless::Vec; | 16 | use heapless::Vec; |
| 17 | 17 | ||
| 18 | pub use self::builder::{Builder, Config}; | 18 | pub use self::builder::{Builder, Config}; |
diff --git a/examples/boot/application/nrf/Cargo.toml b/examples/boot/application/nrf/Cargo.toml index ef9346639..b9ff92578 100644 --- a/examples/boot/application/nrf/Cargo.toml +++ b/examples/boot/application/nrf/Cargo.toml | |||
| @@ -4,7 +4,7 @@ name = "embassy-boot-nrf-examples" | |||
| 4 | version = "0.1.0" | 4 | version = "0.1.0" |
| 5 | 5 | ||
| 6 | [dependencies] | 6 | [dependencies] |
| 7 | embassy-util = { version = "0.1.0", path = "../../../../embassy-util" } | 7 | embassy-sync = { version = "0.1.0", path = "../../../../embassy-sync" } |
| 8 | embassy-executor = { version = "0.1.0", path = "../../../../embassy-executor", features = ["nightly", "integrated-timers"] } | 8 | embassy-executor = { version = "0.1.0", path = "../../../../embassy-executor", features = ["nightly", "integrated-timers"] } |
| 9 | embassy-time = { version = "0.1.0", path = "../../../../embassy-time", features = ["nightly"] } | 9 | embassy-time = { version = "0.1.0", path = "../../../../embassy-time", features = ["nightly"] } |
| 10 | embassy-nrf = { version = "0.1.0", path = "../../../../embassy-nrf", features = ["time-driver-rtc1", "gpiote", "nightly", "nrf52840"] } | 10 | embassy-nrf = { version = "0.1.0", path = "../../../../embassy-nrf", features = ["time-driver-rtc1", "gpiote", "nightly", "nrf52840"] } |
diff --git a/examples/boot/application/stm32f3/Cargo.toml b/examples/boot/application/stm32f3/Cargo.toml index 27eafa653..f143d1e8d 100644 --- a/examples/boot/application/stm32f3/Cargo.toml +++ b/examples/boot/application/stm32f3/Cargo.toml | |||
| @@ -4,7 +4,7 @@ name = "embassy-boot-stm32f3-examples" | |||
| 4 | version = "0.1.0" | 4 | version = "0.1.0" |
| 5 | 5 | ||
| 6 | [dependencies] | 6 | [dependencies] |
| 7 | embassy-util = { version = "0.1.0", path = "../../../../embassy-util", features = ["defmt"] } | 7 | embassy-sync = { version = "0.1.0", path = "../../../../embassy-sync", features = ["defmt"] } |
| 8 | embassy-executor = { version = "0.1.0", path = "../../../../embassy-executor", features = ["nightly", "integrated-timers"] } | 8 | embassy-executor = { version = "0.1.0", path = "../../../../embassy-executor", features = ["nightly", "integrated-timers"] } |
| 9 | embassy-time = { version = "0.1.0", path = "../../../../embassy-time", features = ["nightly", "tick-32768hz"] } | 9 | embassy-time = { version = "0.1.0", path = "../../../../embassy-time", features = ["nightly", "tick-32768hz"] } |
| 10 | embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32f303re", "time-driver-any", "exti"] } | 10 | embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32f303re", "time-driver-any", "exti"] } |
diff --git a/examples/boot/application/stm32f7/Cargo.toml b/examples/boot/application/stm32f7/Cargo.toml index 7de0b82d7..29c87eee1 100644 --- a/examples/boot/application/stm32f7/Cargo.toml +++ b/examples/boot/application/stm32f7/Cargo.toml | |||
| @@ -4,7 +4,7 @@ name = "embassy-boot-stm32f7-examples" | |||
| 4 | version = "0.1.0" | 4 | version = "0.1.0" |
| 5 | 5 | ||
| 6 | [dependencies] | 6 | [dependencies] |
| 7 | embassy-util = { version = "0.1.0", path = "../../../../embassy-util", features = ["defmt"] } | 7 | embassy-sync = { version = "0.1.0", path = "../../../../embassy-sync", features = ["defmt"] } |
| 8 | embassy-executor = { version = "0.1.0", path = "../../../../embassy-executor", features = ["nightly", "integrated-timers"] } | 8 | embassy-executor = { version = "0.1.0", path = "../../../../embassy-executor", features = ["nightly", "integrated-timers"] } |
| 9 | embassy-time = { version = "0.1.0", path = "../../../../embassy-time", features = ["nightly", "tick-32768hz"] } | 9 | embassy-time = { version = "0.1.0", path = "../../../../embassy-time", features = ["nightly", "tick-32768hz"] } |
| 10 | embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32f767zi", "time-driver-any", "exti"] } | 10 | embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32f767zi", "time-driver-any", "exti"] } |
diff --git a/examples/boot/application/stm32h7/Cargo.toml b/examples/boot/application/stm32h7/Cargo.toml index 65d34c70b..5669527fe 100644 --- a/examples/boot/application/stm32h7/Cargo.toml +++ b/examples/boot/application/stm32h7/Cargo.toml | |||
| @@ -4,7 +4,7 @@ name = "embassy-boot-stm32h7-examples" | |||
| 4 | version = "0.1.0" | 4 | version = "0.1.0" |
| 5 | 5 | ||
| 6 | [dependencies] | 6 | [dependencies] |
| 7 | embassy-util = { version = "0.1.0", path = "../../../../embassy-util", features = ["defmt"] } | 7 | embassy-sync = { version = "0.1.0", path = "../../../../embassy-sync", features = ["defmt"] } |
| 8 | embassy-executor = { version = "0.1.0", path = "../../../../embassy-executor", features = ["nightly", "integrated-timers"] } | 8 | embassy-executor = { version = "0.1.0", path = "../../../../embassy-executor", features = ["nightly", "integrated-timers"] } |
| 9 | embassy-time = { version = "0.1.0", path = "../../../../embassy-time", features = ["nightly", "tick-32768hz"] } | 9 | embassy-time = { version = "0.1.0", path = "../../../../embassy-time", features = ["nightly", "tick-32768hz"] } |
| 10 | embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32h743zi", "time-driver-any", "exti"] } | 10 | embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32h743zi", "time-driver-any", "exti"] } |
diff --git a/examples/boot/application/stm32l0/Cargo.toml b/examples/boot/application/stm32l0/Cargo.toml index 8f37869e3..48624d5ec 100644 --- a/examples/boot/application/stm32l0/Cargo.toml +++ b/examples/boot/application/stm32l0/Cargo.toml | |||
| @@ -4,7 +4,7 @@ name = "embassy-boot-stm32l0-examples" | |||
| 4 | version = "0.1.0" | 4 | version = "0.1.0" |
| 5 | 5 | ||
| 6 | [dependencies] | 6 | [dependencies] |
| 7 | embassy-util = { version = "0.1.0", path = "../../../../embassy-util", features = ["defmt"] } | 7 | embassy-sync = { version = "0.1.0", path = "../../../../embassy-sync", features = ["defmt"] } |
| 8 | embassy-executor = { version = "0.1.0", path = "../../../../embassy-executor", features = ["nightly", "integrated-timers"] } | 8 | embassy-executor = { version = "0.1.0", path = "../../../../embassy-executor", features = ["nightly", "integrated-timers"] } |
| 9 | embassy-time = { version = "0.1.0", path = "../../../../embassy-time", features = ["nightly", "tick-32768hz"] } | 9 | embassy-time = { version = "0.1.0", path = "../../../../embassy-time", features = ["nightly", "tick-32768hz"] } |
| 10 | embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32l072cz", "time-driver-any", "exti", "memory-x"] } | 10 | embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32l072cz", "time-driver-any", "exti", "memory-x"] } |
diff --git a/examples/boot/application/stm32l1/Cargo.toml b/examples/boot/application/stm32l1/Cargo.toml index 6abf1986d..00b638ca5 100644 --- a/examples/boot/application/stm32l1/Cargo.toml +++ b/examples/boot/application/stm32l1/Cargo.toml | |||
| @@ -4,7 +4,7 @@ name = "embassy-boot-stm32l1-examples" | |||
| 4 | version = "0.1.0" | 4 | version = "0.1.0" |
| 5 | 5 | ||
| 6 | [dependencies] | 6 | [dependencies] |
| 7 | embassy-util = { version = "0.1.0", path = "../../../../embassy-util", features = ["defmt"] } | 7 | embassy-sync = { version = "0.1.0", path = "../../../../embassy-sync", features = ["defmt"] } |
| 8 | embassy-executor = { version = "0.1.0", path = "../../../../embassy-executor", features = ["nightly", "integrated-timers"] } | 8 | embassy-executor = { version = "0.1.0", path = "../../../../embassy-executor", features = ["nightly", "integrated-timers"] } |
| 9 | embassy-time = { version = "0.1.0", path = "../../../../embassy-time", features = ["nightly", "tick-32768hz"] } | 9 | embassy-time = { version = "0.1.0", path = "../../../../embassy-time", features = ["nightly", "tick-32768hz"] } |
| 10 | embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32l151cb-a", "time-driver-any", "exti"] } | 10 | embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32l151cb-a", "time-driver-any", "exti"] } |
diff --git a/examples/boot/application/stm32l4/Cargo.toml b/examples/boot/application/stm32l4/Cargo.toml index 6f2d12ff1..51ba730d5 100644 --- a/examples/boot/application/stm32l4/Cargo.toml +++ b/examples/boot/application/stm32l4/Cargo.toml | |||
| @@ -4,7 +4,7 @@ name = "embassy-boot-stm32l4-examples" | |||
| 4 | version = "0.1.0" | 4 | version = "0.1.0" |
| 5 | 5 | ||
| 6 | [dependencies] | 6 | [dependencies] |
| 7 | embassy-util = { version = "0.1.0", path = "../../../../embassy-util", features = ["defmt"] } | 7 | embassy-sync = { version = "0.1.0", path = "../../../../embassy-sync", features = ["defmt"] } |
| 8 | embassy-executor = { version = "0.1.0", path = "../../../../embassy-executor", features = ["nightly", "integrated-timers"] } | 8 | embassy-executor = { version = "0.1.0", path = "../../../../embassy-executor", features = ["nightly", "integrated-timers"] } |
| 9 | embassy-time = { version = "0.1.0", path = "../../../../embassy-time", features = ["nightly", "tick-32768hz"] } | 9 | embassy-time = { version = "0.1.0", path = "../../../../embassy-time", features = ["nightly", "tick-32768hz"] } |
| 10 | embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32l475vg", "time-driver-any", "exti"] } | 10 | embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32l475vg", "time-driver-any", "exti"] } |
diff --git a/examples/boot/application/stm32wl/Cargo.toml b/examples/boot/application/stm32wl/Cargo.toml index be97d4ebb..182acf694 100644 --- a/examples/boot/application/stm32wl/Cargo.toml +++ b/examples/boot/application/stm32wl/Cargo.toml | |||
| @@ -4,7 +4,7 @@ name = "embassy-boot-stm32wl-examples" | |||
| 4 | version = "0.1.0" | 4 | version = "0.1.0" |
| 5 | 5 | ||
| 6 | [dependencies] | 6 | [dependencies] |
| 7 | embassy-util = { version = "0.1.0", path = "../../../../embassy-util", features = ["defmt"] } | 7 | embassy-sync = { version = "0.1.0", path = "../../../../embassy-sync", features = ["defmt"] } |
| 8 | embassy-executor = { version = "0.1.0", path = "../../../../embassy-executor", features = ["nightly", "integrated-timers"] } | 8 | embassy-executor = { version = "0.1.0", path = "../../../../embassy-executor", features = ["nightly", "integrated-timers"] } |
| 9 | embassy-time = { version = "0.1.0", path = "../../../../embassy-time", features = ["nightly", "tick-32768hz"] } | 9 | embassy-time = { version = "0.1.0", path = "../../../../embassy-time", features = ["nightly", "tick-32768hz"] } |
| 10 | embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32wl55jc-cm4", "time-driver-any", "exti"] } | 10 | embassy-stm32 = { version = "0.1.0", path = "../../../../embassy-stm32", features = ["unstable-traits", "nightly", "stm32wl55jc-cm4", "time-driver-any", "exti"] } |
diff --git a/examples/nrf-rtos-trace/Cargo.toml b/examples/nrf-rtos-trace/Cargo.toml index b0907f92c..87c9f33f5 100644 --- a/examples/nrf-rtos-trace/Cargo.toml +++ b/examples/nrf-rtos-trace/Cargo.toml | |||
| @@ -8,14 +8,14 @@ default = ["log", "nightly"] | |||
| 8 | nightly = ["embassy-executor/nightly", "embassy-nrf/nightly", "embassy-nrf/unstable-traits"] | 8 | nightly = ["embassy-executor/nightly", "embassy-nrf/nightly", "embassy-nrf/unstable-traits"] |
| 9 | log = [ | 9 | log = [ |
| 10 | "dep:log", | 10 | "dep:log", |
| 11 | "embassy-util/log", | 11 | "embassy-sync/log", |
| 12 | "embassy-executor/log", | 12 | "embassy-executor/log", |
| 13 | "embassy-time/log", | 13 | "embassy-time/log", |
| 14 | "embassy-nrf/log", | 14 | "embassy-nrf/log", |
| 15 | ] | 15 | ] |
| 16 | 16 | ||
| 17 | [dependencies] | 17 | [dependencies] |
| 18 | embassy-util = { version = "0.1.0", path = "../../embassy-util" } | 18 | embassy-sync = { version = "0.1.0", path = "../../embassy-sync" } |
| 19 | embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features=["rtos-trace", "rtos-trace-interrupt", "integrated-timers"] } | 19 | embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features=["rtos-trace", "rtos-trace-interrupt", "integrated-timers"] } |
| 20 | embassy-time = { version = "0.1.0", path = "../../embassy-time" } | 20 | embassy-time = { version = "0.1.0", path = "../../embassy-time" } |
| 21 | embassy-nrf = { version = "0.1.0", path = "../../embassy-nrf", features = ["nrf52840", "time-driver-rtc1", "gpiote", "unstable-pac"] } | 21 | embassy-nrf = { version = "0.1.0", path = "../../embassy-nrf", features = ["nrf52840", "time-driver-rtc1", "gpiote", "unstable-pac"] } |
diff --git a/examples/nrf/Cargo.toml b/examples/nrf/Cargo.toml index 17f29b8fb..b0af0c86e 100644 --- a/examples/nrf/Cargo.toml +++ b/examples/nrf/Cargo.toml | |||
| @@ -8,7 +8,8 @@ default = ["nightly"] | |||
| 8 | nightly = ["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"] | 8 | nightly = ["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] |
| 11 | embassy-util = { version = "0.1.0", path = "../../embassy-util", features = ["defmt"] } | 11 | embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } |
| 12 | embassy-sync = { version = "0.1.0", path = "../../embassy-sync", features = ["defmt"] } | ||
| 12 | embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "integrated-timers"] } | 13 | embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "integrated-timers"] } |
| 13 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime"] } | 14 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime"] } |
| 14 | embassy-nrf = { version = "0.1.0", path = "../../embassy-nrf", features = ["defmt", "nrf52840", "time-driver-rtc1", "gpiote", "unstable-pac"] } | 15 | embassy-nrf = { version = "0.1.0", path = "../../embassy-nrf", features = ["defmt", "nrf52840", "time-driver-rtc1", "gpiote", "unstable-pac"] } |
diff --git a/examples/nrf/src/bin/channel.rs b/examples/nrf/src/bin/channel.rs index 195200988..8371fd0af 100644 --- a/examples/nrf/src/bin/channel.rs +++ b/examples/nrf/src/bin/channel.rs | |||
| @@ -5,9 +5,9 @@ | |||
| 5 | use defmt::unwrap; | 5 | use defmt::unwrap; |
| 6 | use embassy_executor::Spawner; | 6 | use embassy_executor::Spawner; |
| 7 | use embassy_nrf::gpio::{Level, Output, OutputDrive}; | 7 | use embassy_nrf::gpio::{Level, Output, OutputDrive}; |
| 8 | use embassy_sync::blocking_mutex::raw::ThreadModeRawMutex; | ||
| 9 | use embassy_sync::channel::mpmc::Channel; | ||
| 8 | use embassy_time::{Duration, Timer}; | 10 | use embassy_time::{Duration, Timer}; |
| 9 | use embassy_util::blocking_mutex::raw::ThreadModeRawMutex; | ||
| 10 | use embassy_util::channel::mpmc::Channel; | ||
| 11 | use {defmt_rtt as _, panic_probe as _}; | 11 | use {defmt_rtt as _, panic_probe as _}; |
| 12 | 12 | ||
| 13 | enum LedState { | 13 | enum LedState { |
diff --git a/examples/nrf/src/bin/channel_sender_receiver.rs b/examples/nrf/src/bin/channel_sender_receiver.rs index d250b6a5c..55d1fccb2 100644 --- a/examples/nrf/src/bin/channel_sender_receiver.rs +++ b/examples/nrf/src/bin/channel_sender_receiver.rs | |||
| @@ -5,9 +5,9 @@ | |||
| 5 | use defmt::unwrap; | 5 | use defmt::unwrap; |
| 6 | use embassy_executor::Spawner; | 6 | use embassy_executor::Spawner; |
| 7 | use embassy_nrf::gpio::{AnyPin, Level, Output, OutputDrive, Pin}; | 7 | use embassy_nrf::gpio::{AnyPin, Level, Output, OutputDrive, Pin}; |
| 8 | use embassy_sync::blocking_mutex::raw::NoopRawMutex; | ||
| 9 | use embassy_sync::channel::mpmc::{Channel, Receiver, Sender}; | ||
| 8 | use embassy_time::{Duration, Timer}; | 10 | use embassy_time::{Duration, Timer}; |
| 9 | use embassy_util::blocking_mutex::raw::NoopRawMutex; | ||
| 10 | use embassy_util::channel::mpmc::{Channel, Receiver, Sender}; | ||
| 11 | use static_cell::StaticCell; | 11 | use static_cell::StaticCell; |
| 12 | use {defmt_rtt as _, panic_probe as _}; | 12 | use {defmt_rtt as _, panic_probe as _}; |
| 13 | 13 | ||
diff --git a/examples/nrf/src/bin/mutex.rs b/examples/nrf/src/bin/mutex.rs index 876297883..c402c6ba1 100644 --- a/examples/nrf/src/bin/mutex.rs +++ b/examples/nrf/src/bin/mutex.rs | |||
| @@ -4,9 +4,9 @@ | |||
| 4 | 4 | ||
| 5 | use defmt::{info, unwrap}; | 5 | use defmt::{info, unwrap}; |
| 6 | use embassy_executor::Spawner; | 6 | use embassy_executor::Spawner; |
| 7 | use embassy_sync::blocking_mutex::raw::ThreadModeRawMutex; | ||
| 8 | use embassy_sync::mutex::Mutex; | ||
| 7 | use embassy_time::{Duration, Timer}; | 9 | use embassy_time::{Duration, Timer}; |
| 8 | use embassy_util::blocking_mutex::raw::ThreadModeRawMutex; | ||
| 9 | use embassy_util::mutex::Mutex; | ||
| 10 | use {defmt_rtt as _, panic_probe as _}; | 10 | use {defmt_rtt as _, panic_probe as _}; |
| 11 | 11 | ||
| 12 | static MUTEX: Mutex<ThreadModeRawMutex, u32> = Mutex::new(0); | 12 | static MUTEX: Mutex<ThreadModeRawMutex, u32> = Mutex::new(0); |
diff --git a/examples/nrf/src/bin/pubsub.rs b/examples/nrf/src/bin/pubsub.rs index 1d90217f2..64fed641b 100644 --- a/examples/nrf/src/bin/pubsub.rs +++ b/examples/nrf/src/bin/pubsub.rs | |||
| @@ -4,9 +4,9 @@ | |||
| 4 | 4 | ||
| 5 | use defmt::unwrap; | 5 | use defmt::unwrap; |
| 6 | use embassy_executor::Spawner; | 6 | use embassy_executor::Spawner; |
| 7 | use embassy_sync::blocking_mutex::raw::ThreadModeRawMutex; | ||
| 8 | use embassy_sync::channel::pubsub::{DynSubscriber, PubSubChannel, Subscriber}; | ||
| 7 | use embassy_time::{Duration, Timer}; | 9 | use embassy_time::{Duration, Timer}; |
| 8 | use embassy_util::blocking_mutex::raw::ThreadModeRawMutex; | ||
| 9 | use embassy_util::channel::pubsub::{DynSubscriber, PubSubChannel, Subscriber}; | ||
| 10 | use {defmt_rtt as _, panic_probe as _}; | 10 | use {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 |
diff --git a/examples/nrf/src/bin/uart_split.rs b/examples/nrf/src/bin/uart_split.rs index dab8e475d..88b9c0a81 100644 --- a/examples/nrf/src/bin/uart_split.rs +++ b/examples/nrf/src/bin/uart_split.rs | |||
| @@ -7,8 +7,8 @@ use embassy_executor::Spawner; | |||
| 7 | use embassy_nrf::peripherals::UARTE0; | 7 | use embassy_nrf::peripherals::UARTE0; |
| 8 | use embassy_nrf::uarte::UarteRx; | 8 | use embassy_nrf::uarte::UarteRx; |
| 9 | use embassy_nrf::{interrupt, uarte}; | 9 | use embassy_nrf::{interrupt, uarte}; |
| 10 | use embassy_util::blocking_mutex::raw::ThreadModeRawMutex; | 10 | use embassy_sync::blocking_mutex::raw::ThreadModeRawMutex; |
| 11 | use embassy_util::channel::mpmc::Channel; | 11 | use embassy_sync::channel::mpmc::Channel; |
| 12 | use {defmt_rtt as _, panic_probe as _}; | 12 | use {defmt_rtt as _, panic_probe as _}; |
| 13 | 13 | ||
| 14 | static CHANNEL: Channel<ThreadModeRawMutex, [u8; 8], 1> = Channel::new(); | 14 | static CHANNEL: Channel<ThreadModeRawMutex, [u8; 8], 1> = Channel::new(); |
diff --git a/examples/nrf/src/bin/usb_ethernet.rs b/examples/nrf/src/bin/usb_ethernet.rs index d427f7563..0200d8807 100644 --- a/examples/nrf/src/bin/usb_ethernet.rs +++ b/examples/nrf/src/bin/usb_ethernet.rs | |||
| @@ -14,10 +14,10 @@ use embassy_net::{PacketBox, PacketBoxExt, PacketBuf, Stack, StackResources}; | |||
| 14 | use embassy_nrf::rng::Rng; | 14 | use embassy_nrf::rng::Rng; |
| 15 | use embassy_nrf::usb::{Driver, PowerUsb}; | 15 | use embassy_nrf::usb::{Driver, PowerUsb}; |
| 16 | use embassy_nrf::{interrupt, pac, peripherals}; | 16 | use embassy_nrf::{interrupt, pac, peripherals}; |
| 17 | use embassy_sync::blocking_mutex::raw::ThreadModeRawMutex; | ||
| 18 | use embassy_sync::channel::mpmc::Channel; | ||
| 17 | use embassy_usb::{Builder, Config, UsbDevice}; | 19 | use embassy_usb::{Builder, Config, UsbDevice}; |
| 18 | use embassy_usb_ncm::{CdcNcmClass, Receiver, Sender, State}; | 20 | use embassy_usb_ncm::{CdcNcmClass, Receiver, Sender, State}; |
| 19 | use embassy_util::blocking_mutex::raw::ThreadModeRawMutex; | ||
| 20 | use embassy_util::channel::mpmc::Channel; | ||
| 21 | use embedded_io::asynch::{Read, Write}; | 21 | use embedded_io::asynch::{Read, Write}; |
| 22 | use static_cell::StaticCell; | 22 | use static_cell::StaticCell; |
| 23 | use {defmt_rtt as _, panic_probe as _}; | 23 | use {defmt_rtt as _, panic_probe as _}; |
diff --git a/examples/nrf/src/bin/usb_hid_keyboard.rs b/examples/nrf/src/bin/usb_hid_keyboard.rs index cf0078eec..d7c6dafdf 100644 --- a/examples/nrf/src/bin/usb_hid_keyboard.rs +++ b/examples/nrf/src/bin/usb_hid_keyboard.rs | |||
| @@ -8,14 +8,14 @@ use core::sync::atomic::{AtomicBool, Ordering}; | |||
| 8 | 8 | ||
| 9 | use defmt::*; | 9 | use defmt::*; |
| 10 | use embassy_executor::Spawner; | 10 | use embassy_executor::Spawner; |
| 11 | use embassy_futures::{select, Either}; | ||
| 11 | use embassy_nrf::gpio::{Input, Pin, Pull}; | 12 | use embassy_nrf::gpio::{Input, Pin, Pull}; |
| 12 | use embassy_nrf::usb::{Driver, PowerUsb}; | 13 | use embassy_nrf::usb::{Driver, PowerUsb}; |
| 13 | use embassy_nrf::{interrupt, pac}; | 14 | use embassy_nrf::{interrupt, pac}; |
| 15 | use embassy_sync::channel::signal::Signal; | ||
| 14 | use embassy_usb::control::OutResponse; | 16 | use embassy_usb::control::OutResponse; |
| 15 | use embassy_usb::{Builder, Config, DeviceStateHandler}; | 17 | use embassy_usb::{Builder, Config, DeviceStateHandler}; |
| 16 | use embassy_usb_hid::{HidReaderWriter, ReportId, RequestHandler, State}; | 18 | use embassy_usb_hid::{HidReaderWriter, ReportId, RequestHandler, State}; |
| 17 | use embassy_util::channel::signal::Signal; | ||
| 18 | use embassy_util::{select, Either}; | ||
| 19 | use futures::future::join; | 19 | use futures::future::join; |
| 20 | use usbd_hid::descriptor::{KeyboardReport, SerializedDescriptor}; | 20 | use usbd_hid::descriptor::{KeyboardReport, SerializedDescriptor}; |
| 21 | use {defmt_rtt as _, panic_probe as _}; | 21 | use {defmt_rtt as _, panic_probe as _}; |
diff --git a/examples/rp/Cargo.toml b/examples/rp/Cargo.toml index c2dcf429a..d804a660b 100644 --- a/examples/rp/Cargo.toml +++ b/examples/rp/Cargo.toml | |||
| @@ -5,7 +5,7 @@ version = "0.1.0" | |||
| 5 | 5 | ||
| 6 | 6 | ||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | embassy-util = { version = "0.1.0", path = "../../embassy-util", features = ["defmt"] } | 8 | embassy-sync = { version = "0.1.0", path = "../../embassy-sync", features = ["defmt"] } |
| 9 | embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "integrated-timers"] } | 9 | embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "integrated-timers"] } |
| 10 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime"] } | 10 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime"] } |
| 11 | embassy-rp = { version = "0.1.0", path = "../../embassy-rp", features = ["defmt", "unstable-traits", "nightly", "unstable-pac"] } | 11 | embassy-rp = { version = "0.1.0", path = "../../embassy-rp", features = ["defmt", "unstable-traits", "nightly", "unstable-pac"] } |
diff --git a/examples/std/Cargo.toml b/examples/std/Cargo.toml index 164a2b42d..c7cec6b19 100644 --- a/examples/std/Cargo.toml +++ b/examples/std/Cargo.toml | |||
| @@ -4,7 +4,7 @@ name = "embassy-std-examples" | |||
| 4 | version = "0.1.0" | 4 | version = "0.1.0" |
| 5 | 5 | ||
| 6 | [dependencies] | 6 | [dependencies] |
| 7 | embassy-util = { version = "0.1.0", path = "../../embassy-util", features = ["log"] } | 7 | embassy-sync = { version = "0.1.0", path = "../../embassy-sync", features = ["log"] } |
| 8 | embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["log", "std", "nightly", "integrated-timers"] } | 8 | embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["log", "std", "nightly", "integrated-timers"] } |
| 9 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["log", "std", "nightly"] } | 9 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["log", "std", "nightly"] } |
| 10 | embassy-net = { version = "0.1.0", path = "../../embassy-net", features=[ "std", "log", "medium-ethernet", "tcp", "udp", "dhcpv4", "pool-16"] } | 10 | embassy-net = { version = "0.1.0", path = "../../embassy-net", features=[ "std", "log", "medium-ethernet", "tcp", "udp", "dhcpv4", "pool-16"] } |
diff --git a/examples/stm32f0/Cargo.toml b/examples/stm32f0/Cargo.toml index 8476200d4..cd2995d2c 100644 --- a/examples/stm32f0/Cargo.toml +++ b/examples/stm32f0/Cargo.toml | |||
| @@ -11,7 +11,7 @@ cortex-m-rt = "0.7.0" | |||
| 11 | defmt = "0.3" | 11 | defmt = "0.3" |
| 12 | defmt-rtt = "0.3" | 12 | defmt-rtt = "0.3" |
| 13 | panic-probe = "0.3" | 13 | panic-probe = "0.3" |
| 14 | embassy-util = { version = "0.1.0", path = "../../embassy-util", features = ["defmt"] } | 14 | embassy-sync = { version = "0.1.0", path = "../../embassy-sync", features = ["defmt"] } |
| 15 | embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "integrated-timers"] } | 15 | embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "integrated-timers"] } |
| 16 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-32768hz"] } | 16 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-32768hz"] } |
| 17 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "memory-x", "stm32f030f4", "time-driver-any"] } | 17 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "memory-x", "stm32f030f4", "time-driver-any"] } |
diff --git a/examples/stm32f1/Cargo.toml b/examples/stm32f1/Cargo.toml index fbc96400c..8660e743d 100644 --- a/examples/stm32f1/Cargo.toml +++ b/examples/stm32f1/Cargo.toml | |||
| @@ -4,7 +4,7 @@ name = "embassy-stm32f1-examples" | |||
| 4 | version = "0.1.0" | 4 | version = "0.1.0" |
| 5 | 5 | ||
| 6 | [dependencies] | 6 | [dependencies] |
| 7 | embassy-util = { version = "0.1.0", path = "../../embassy-util", features = ["defmt"] } | 7 | embassy-sync = { version = "0.1.0", path = "../../embassy-sync", features = ["defmt"] } |
| 8 | embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "integrated-timers"] } | 8 | embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "integrated-timers"] } |
| 9 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-32768hz"] } | 9 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-32768hz"] } |
| 10 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32f103c8", "unstable-pac", "memory-x", "time-driver-any"] } | 10 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32f103c8", "unstable-pac", "memory-x", "time-driver-any"] } |
diff --git a/examples/stm32f2/Cargo.toml b/examples/stm32f2/Cargo.toml index 27894df50..b4bff4d85 100644 --- a/examples/stm32f2/Cargo.toml +++ b/examples/stm32f2/Cargo.toml | |||
| @@ -4,7 +4,7 @@ name = "embassy-stm32f2-examples" | |||
| 4 | version = "0.1.0" | 4 | version = "0.1.0" |
| 5 | 5 | ||
| 6 | [dependencies] | 6 | [dependencies] |
| 7 | embassy-util = { version = "0.1.0", path = "../../embassy-util", features = ["defmt"] } | 7 | embassy-sync = { version = "0.1.0", path = "../../embassy-sync", features = ["defmt"] } |
| 8 | embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "integrated-timers"] } | 8 | embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "integrated-timers"] } |
| 9 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-32768hz"] } | 9 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-32768hz"] } |
| 10 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32f207zg", "unstable-pac", "memory-x", "time-driver-any", "exti"] } | 10 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32f207zg", "unstable-pac", "memory-x", "time-driver-any", "exti"] } |
diff --git a/examples/stm32f3/Cargo.toml b/examples/stm32f3/Cargo.toml index 4e6b0ea1e..d152b145f 100644 --- a/examples/stm32f3/Cargo.toml +++ b/examples/stm32f3/Cargo.toml | |||
| @@ -4,7 +4,7 @@ name = "embassy-stm32f3-examples" | |||
| 4 | version = "0.1.0" | 4 | version = "0.1.0" |
| 5 | 5 | ||
| 6 | [dependencies] | 6 | [dependencies] |
| 7 | embassy-util = { version = "0.1.0", path = "../../embassy-util", features = ["defmt"] } | 7 | embassy-sync = { version = "0.1.0", path = "../../embassy-sync", features = ["defmt"] } |
| 8 | embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "integrated-timers"] } | 8 | embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "integrated-timers"] } |
| 9 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-32768hz"] } | 9 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-32768hz"] } |
| 10 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32f303ze", "unstable-pac", "memory-x", "time-driver-any", "exti"] } | 10 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32f303ze", "unstable-pac", "memory-x", "time-driver-any", "exti"] } |
diff --git a/examples/stm32f3/src/bin/button_events.rs b/examples/stm32f3/src/bin/button_events.rs index 61fc6dcab..edf34b4d1 100644 --- a/examples/stm32f3/src/bin/button_events.rs +++ b/examples/stm32f3/src/bin/button_events.rs | |||
| @@ -15,9 +15,9 @@ use embassy_executor::Spawner; | |||
| 15 | use embassy_stm32::exti::ExtiInput; | 15 | use embassy_stm32::exti::ExtiInput; |
| 16 | use embassy_stm32::gpio::{AnyPin, Input, Level, Output, Pin, Pull, Speed}; | 16 | use embassy_stm32::gpio::{AnyPin, Input, Level, Output, Pin, Pull, Speed}; |
| 17 | use embassy_stm32::peripherals::PA0; | 17 | use embassy_stm32::peripherals::PA0; |
| 18 | use embassy_sync::blocking_mutex::raw::ThreadModeRawMutex; | ||
| 19 | use embassy_sync::channel::mpmc::Channel; | ||
| 18 | use embassy_time::{with_timeout, Duration, Timer}; | 20 | use embassy_time::{with_timeout, Duration, Timer}; |
| 19 | use embassy_util::blocking_mutex::raw::ThreadModeRawMutex; | ||
| 20 | use embassy_util::channel::mpmc::Channel; | ||
| 21 | use {defmt_rtt as _, panic_probe as _}; | 21 | use {defmt_rtt as _, panic_probe as _}; |
| 22 | 22 | ||
| 23 | struct Leds<'a> { | 23 | struct Leds<'a> { |
diff --git a/examples/stm32f4/Cargo.toml b/examples/stm32f4/Cargo.toml index f93a1d0f9..9bfdda92d 100644 --- a/examples/stm32f4/Cargo.toml +++ b/examples/stm32f4/Cargo.toml | |||
| @@ -5,7 +5,7 @@ version = "0.1.0" | |||
| 5 | 5 | ||
| 6 | 6 | ||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | embassy-util = { version = "0.1.0", path = "../../embassy-util", features = ["defmt"] } | 8 | embassy-sync = { version = "0.1.0", path = "../../embassy-sync", features = ["defmt"] } |
| 9 | embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "integrated-timers"] } | 9 | embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "integrated-timers"] } |
| 10 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "unstable-traits", "tick-32768hz"] } | 10 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "unstable-traits", "tick-32768hz"] } |
| 11 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "unstable-traits", "defmt", "stm32f429zi", "unstable-pac", "memory-x", "time-driver-any", "exti"] } | 11 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "unstable-traits", "defmt", "stm32f429zi", "unstable-pac", "memory-x", "time-driver-any", "exti"] } |
diff --git a/examples/stm32f7/Cargo.toml b/examples/stm32f7/Cargo.toml index e286d2310..a446fe3fb 100644 --- a/examples/stm32f7/Cargo.toml +++ b/examples/stm32f7/Cargo.toml | |||
| @@ -4,7 +4,7 @@ name = "embassy-stm32f7-examples" | |||
| 4 | version = "0.1.0" | 4 | version = "0.1.0" |
| 5 | 5 | ||
| 6 | [dependencies] | 6 | [dependencies] |
| 7 | embassy-util = { version = "0.1.0", path = "../../embassy-util", features = ["defmt"] } | 7 | embassy-sync = { version = "0.1.0", path = "../../embassy-sync", features = ["defmt"] } |
| 8 | embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "integrated-timers"] } | 8 | embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "integrated-timers"] } |
| 9 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-32768hz"] } | 9 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-32768hz"] } |
| 10 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "net", "stm32f767zi", "unstable-pac", "time-driver-any", "exti"] } | 10 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "net", "stm32f767zi", "unstable-pac", "time-driver-any", "exti"] } |
diff --git a/examples/stm32g0/Cargo.toml b/examples/stm32g0/Cargo.toml index 5c80d43eb..30f2b86f8 100644 --- a/examples/stm32g0/Cargo.toml +++ b/examples/stm32g0/Cargo.toml | |||
| @@ -4,7 +4,7 @@ name = "embassy-stm32g0-examples" | |||
| 4 | version = "0.1.0" | 4 | version = "0.1.0" |
| 5 | 5 | ||
| 6 | [dependencies] | 6 | [dependencies] |
| 7 | embassy-util = { version = "0.1.0", path = "../../embassy-util", features = ["defmt"] } | 7 | embassy-sync = { version = "0.1.0", path = "../../embassy-sync", features = ["defmt"] } |
| 8 | embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "integrated-timers"] } | 8 | embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "integrated-timers"] } |
| 9 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-32768hz"] } | 9 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-32768hz"] } |
| 10 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "time-driver-any", "stm32g071rb", "memory-x", "unstable-pac", "exti"] } | 10 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "time-driver-any", "stm32g071rb", "memory-x", "unstable-pac", "exti"] } |
diff --git a/examples/stm32g4/Cargo.toml b/examples/stm32g4/Cargo.toml index 74c645cf5..f81df0b70 100644 --- a/examples/stm32g4/Cargo.toml +++ b/examples/stm32g4/Cargo.toml | |||
| @@ -4,7 +4,7 @@ name = "embassy-stm32g4-examples" | |||
| 4 | version = "0.1.0" | 4 | version = "0.1.0" |
| 5 | 5 | ||
| 6 | [dependencies] | 6 | [dependencies] |
| 7 | embassy-util = { version = "0.1.0", path = "../../embassy-util", features = ["defmt"] } | 7 | embassy-sync = { version = "0.1.0", path = "../../embassy-sync", features = ["defmt"] } |
| 8 | embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "integrated-timers"] } | 8 | embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "integrated-timers"] } |
| 9 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-32768hz"] } | 9 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-32768hz"] } |
| 10 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "time-driver-any", "stm32g491re", "memory-x", "unstable-pac", "exti"] } | 10 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "time-driver-any", "stm32g491re", "memory-x", "unstable-pac", "exti"] } |
diff --git a/examples/stm32h7/Cargo.toml b/examples/stm32h7/Cargo.toml index fc5f74f99..0f76f3226 100644 --- a/examples/stm32h7/Cargo.toml +++ b/examples/stm32h7/Cargo.toml | |||
| @@ -4,7 +4,7 @@ name = "embassy-stm32h7-examples" | |||
| 4 | version = "0.1.0" | 4 | version = "0.1.0" |
| 5 | 5 | ||
| 6 | [dependencies] | 6 | [dependencies] |
| 7 | embassy-util = { version = "0.1.0", path = "../../embassy-util", features = ["defmt"] } | 7 | embassy-sync = { version = "0.1.0", path = "../../embassy-sync", features = ["defmt"] } |
| 8 | embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "integrated-timers"] } | 8 | embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "integrated-timers"] } |
| 9 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "unstable-traits", "tick-32768hz"] } | 9 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "unstable-traits", "tick-32768hz"] } |
| 10 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32h743bi", "net", "time-driver-any", "exti", "unstable-pac", "unstable-traits"] } | 10 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32h743bi", "net", "time-driver-any", "exti", "unstable-pac", "unstable-traits"] } |
diff --git a/examples/stm32h7/src/bin/signal.rs b/examples/stm32h7/src/bin/signal.rs index be2ac268e..ae41b07a9 100644 --- a/examples/stm32h7/src/bin/signal.rs +++ b/examples/stm32h7/src/bin/signal.rs | |||
| @@ -4,8 +4,8 @@ | |||
| 4 | 4 | ||
| 5 | use defmt::{info, unwrap}; | 5 | use defmt::{info, unwrap}; |
| 6 | use embassy_executor::Spawner; | 6 | use embassy_executor::Spawner; |
| 7 | use embassy_sync::channel::signal::Signal; | ||
| 7 | use embassy_time::{Duration, Timer}; | 8 | use embassy_time::{Duration, Timer}; |
| 8 | use embassy_util::channel::signal::Signal; | ||
| 9 | use {defmt_rtt as _, panic_probe as _}; | 9 | use {defmt_rtt as _, panic_probe as _}; |
| 10 | 10 | ||
| 11 | static SIGNAL: Signal<u32> = Signal::new(); | 11 | static SIGNAL: Signal<u32> = Signal::new(); |
diff --git a/examples/stm32h7/src/bin/usart_split.rs b/examples/stm32h7/src/bin/usart_split.rs index 64080ec45..55630dd39 100644 --- a/examples/stm32h7/src/bin/usart_split.rs +++ b/examples/stm32h7/src/bin/usart_split.rs | |||
| @@ -7,8 +7,8 @@ use embassy_executor::Spawner; | |||
| 7 | use embassy_stm32::dma::NoDma; | 7 | use embassy_stm32::dma::NoDma; |
| 8 | use embassy_stm32::peripherals::{DMA1_CH1, UART7}; | 8 | use embassy_stm32::peripherals::{DMA1_CH1, UART7}; |
| 9 | use embassy_stm32::usart::{Config, Uart, UartRx}; | 9 | use embassy_stm32::usart::{Config, Uart, UartRx}; |
| 10 | use embassy_util::blocking_mutex::raw::ThreadModeRawMutex; | 10 | use embassy_sync::blocking_mutex::raw::ThreadModeRawMutex; |
| 11 | use embassy_util::channel::mpmc::Channel; | 11 | use embassy_sync::channel::mpmc::Channel; |
| 12 | use {defmt_rtt as _, panic_probe as _}; | 12 | use {defmt_rtt as _, panic_probe as _}; |
| 13 | 13 | ||
| 14 | #[embassy_executor::task] | 14 | #[embassy_executor::task] |
diff --git a/examples/stm32l0/Cargo.toml b/examples/stm32l0/Cargo.toml index 72365a640..11751a21d 100644 --- a/examples/stm32l0/Cargo.toml +++ b/examples/stm32l0/Cargo.toml | |||
| @@ -8,7 +8,7 @@ default = ["nightly"] | |||
| 8 | nightly = ["embassy-stm32/nightly", "embassy-lora", "lorawan-device", "lorawan", "embedded-io/async"] | 8 | nightly = ["embassy-stm32/nightly", "embassy-lora", "lorawan-device", "lorawan", "embedded-io/async"] |
| 9 | 9 | ||
| 10 | [dependencies] | 10 | [dependencies] |
| 11 | embassy-util = { version = "0.1.0", path = "../../embassy-util", features = ["defmt"] } | 11 | embassy-sync = { version = "0.1.0", path = "../../embassy-sync", features = ["defmt"] } |
| 12 | embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "integrated-timers"] } | 12 | embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "integrated-timers"] } |
| 13 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-32768hz"] } | 13 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-32768hz"] } |
| 14 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["defmt", "stm32l072cz", "time-driver-any", "exti", "unstable-traits", "memory-x"] } | 14 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["defmt", "stm32l072cz", "time-driver-any", "exti", "unstable-traits", "memory-x"] } |
diff --git a/examples/stm32l1/Cargo.toml b/examples/stm32l1/Cargo.toml index 43f844b67..18b35b305 100644 --- a/examples/stm32l1/Cargo.toml +++ b/examples/stm32l1/Cargo.toml | |||
| @@ -4,7 +4,7 @@ name = "embassy-stm32l1-examples" | |||
| 4 | version = "0.1.0" | 4 | version = "0.1.0" |
| 5 | 5 | ||
| 6 | [dependencies] | 6 | [dependencies] |
| 7 | embassy-util = { version = "0.1.0", path = "../../embassy-util", features = ["defmt"] } | 7 | embassy-sync = { version = "0.1.0", path = "../../embassy-sync", features = ["defmt"] } |
| 8 | embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "integrated-timers"] } | 8 | embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "integrated-timers"] } |
| 9 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-32768hz"] } | 9 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-32768hz"] } |
| 10 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32l151cb-a", "time-driver-any", "memory-x"] } | 10 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32l151cb-a", "time-driver-any", "memory-x"] } |
diff --git a/examples/stm32l4/Cargo.toml b/examples/stm32l4/Cargo.toml index eaffa253e..cb7238e4c 100644 --- a/examples/stm32l4/Cargo.toml +++ b/examples/stm32l4/Cargo.toml | |||
| @@ -6,7 +6,7 @@ version = "0.1.0" | |||
| 6 | [features] | 6 | [features] |
| 7 | 7 | ||
| 8 | [dependencies] | 8 | [dependencies] |
| 9 | embassy-util = { version = "0.1.0", path = "../../embassy-util", features = ["defmt"] } | 9 | embassy-sync = { version = "0.1.0", path = "../../embassy-sync", features = ["defmt"] } |
| 10 | embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "integrated-timers"] } | 10 | embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "integrated-timers"] } |
| 11 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-32768hz"] } | 11 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-32768hz"] } |
| 12 | embassy-embedded-hal = { version = "0.1.0", path = "../../embassy-embedded-hal" } | 12 | embassy-embedded-hal = { version = "0.1.0", path = "../../embassy-embedded-hal" } |
diff --git a/examples/stm32l5/Cargo.toml b/examples/stm32l5/Cargo.toml index d8e78088a..624c73c26 100644 --- a/examples/stm32l5/Cargo.toml +++ b/examples/stm32l5/Cargo.toml | |||
| @@ -6,7 +6,7 @@ version = "0.1.0" | |||
| 6 | [features] | 6 | [features] |
| 7 | 7 | ||
| 8 | [dependencies] | 8 | [dependencies] |
| 9 | embassy-util = { version = "0.1.0", path = "../../embassy-util", features = ["defmt"] } | 9 | embassy-sync = { version = "0.1.0", path = "../../embassy-sync", features = ["defmt"] } |
| 10 | embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "integrated-timers"] } | 10 | embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "integrated-timers"] } |
| 11 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-32768hz"] } | 11 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-32768hz"] } |
| 12 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "unstable-pac", "stm32l552ze", "time-driver-any", "exti", "unstable-traits", "memory-x"] } | 12 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "unstable-pac", "stm32l552ze", "time-driver-any", "exti", "unstable-traits", "memory-x"] } |
diff --git a/examples/stm32l5/src/bin/usb_ethernet.rs b/examples/stm32l5/src/bin/usb_ethernet.rs index 959195518..b21d8629f 100644 --- a/examples/stm32l5/src/bin/usb_ethernet.rs +++ b/examples/stm32l5/src/bin/usb_ethernet.rs | |||
| @@ -15,10 +15,10 @@ use embassy_stm32::rng::Rng; | |||
| 15 | use embassy_stm32::time::Hertz; | 15 | use embassy_stm32::time::Hertz; |
| 16 | use embassy_stm32::usb::Driver; | 16 | use embassy_stm32::usb::Driver; |
| 17 | use embassy_stm32::{interrupt, Config}; | 17 | use embassy_stm32::{interrupt, Config}; |
| 18 | use embassy_sync::blocking_mutex::raw::ThreadModeRawMutex; | ||
| 19 | use embassy_sync::channel::mpmc::Channel; | ||
| 18 | use embassy_usb::{Builder, UsbDevice}; | 20 | use embassy_usb::{Builder, UsbDevice}; |
| 19 | use embassy_usb_ncm::{CdcNcmClass, Receiver, Sender, State}; | 21 | use embassy_usb_ncm::{CdcNcmClass, Receiver, Sender, State}; |
| 20 | use embassy_util::blocking_mutex::raw::ThreadModeRawMutex; | ||
| 21 | use embassy_util::channel::mpmc::Channel; | ||
| 22 | use embedded_io::asynch::{Read, Write}; | 22 | use embedded_io::asynch::{Read, Write}; |
| 23 | use rand_core::RngCore; | 23 | use rand_core::RngCore; |
| 24 | use static_cell::StaticCell; | 24 | use static_cell::StaticCell; |
diff --git a/examples/stm32u5/Cargo.toml b/examples/stm32u5/Cargo.toml index 48833664a..ff0ec9f42 100644 --- a/examples/stm32u5/Cargo.toml +++ b/examples/stm32u5/Cargo.toml | |||
| @@ -4,7 +4,7 @@ name = "embassy-stm32u5-examples" | |||
| 4 | version = "0.1.0" | 4 | version = "0.1.0" |
| 5 | 5 | ||
| 6 | [dependencies] | 6 | [dependencies] |
| 7 | embassy-util = { version = "0.1.0", path = "../../embassy-util", features = ["defmt"] } | 7 | embassy-sync = { version = "0.1.0", path = "../../embassy-sync", features = ["defmt"] } |
| 8 | embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "integrated-timers"] } | 8 | embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "integrated-timers"] } |
| 9 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-32768hz"] } | 9 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-32768hz"] } |
| 10 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "unstable-pac", "stm32u585ai", "time-driver-any", "memory-x" ] } | 10 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "unstable-pac", "stm32u585ai", "time-driver-any", "memory-x" ] } |
diff --git a/examples/stm32wb/Cargo.toml b/examples/stm32wb/Cargo.toml index b46300764..3b10da0ad 100644 --- a/examples/stm32wb/Cargo.toml +++ b/examples/stm32wb/Cargo.toml | |||
| @@ -4,7 +4,7 @@ name = "embassy-stm32wb-examples" | |||
| 4 | version = "0.1.0" | 4 | version = "0.1.0" |
| 5 | 5 | ||
| 6 | [dependencies] | 6 | [dependencies] |
| 7 | embassy-util = { version = "0.1.0", path = "../../embassy-util", features = ["defmt"] } | 7 | embassy-sync = { version = "0.1.0", path = "../../embassy-sync", features = ["defmt"] } |
| 8 | embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "integrated-timers"] } | 8 | embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "integrated-timers"] } |
| 9 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-32768hz"] } | 9 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-32768hz"] } |
| 10 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32wb55cc", "time-driver-any", "exti"] } | 10 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32wb55cc", "time-driver-any", "exti"] } |
diff --git a/examples/stm32wl/Cargo.toml b/examples/stm32wl/Cargo.toml index ae33478af..5f6679f4b 100644 --- a/examples/stm32wl/Cargo.toml +++ b/examples/stm32wl/Cargo.toml | |||
| @@ -4,7 +4,7 @@ name = "embassy-stm32wl-examples" | |||
| 4 | version = "0.1.0" | 4 | version = "0.1.0" |
| 5 | 5 | ||
| 6 | [dependencies] | 6 | [dependencies] |
| 7 | embassy-util = { version = "0.1.0", path = "../../embassy-util", features = ["defmt"] } | 7 | embassy-sync = { version = "0.1.0", path = "../../embassy-sync", features = ["defmt"] } |
| 8 | embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "integrated-timers"] } | 8 | embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "integrated-timers"] } |
| 9 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-32768hz"] } | 9 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-32768hz"] } |
| 10 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32wl55jc-cm4", "time-driver-any", "memory-x", "subghz", "unstable-pac", "exti"] } | 10 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32wl55jc-cm4", "time-driver-any", "memory-x", "subghz", "unstable-pac", "exti"] } |
diff --git a/examples/stm32wl/src/bin/subghz.rs b/examples/stm32wl/src/bin/subghz.rs index d16e3f5e4..6d54e8503 100644 --- a/examples/stm32wl/src/bin/subghz.rs +++ b/examples/stm32wl/src/bin/subghz.rs | |||
| @@ -13,7 +13,7 @@ use embassy_stm32::gpio::{Input, Level, Output, Pull, Speed}; | |||
| 13 | use embassy_stm32::interrupt; | 13 | use embassy_stm32::interrupt; |
| 14 | use embassy_stm32::interrupt::{Interrupt, InterruptExt}; | 14 | use embassy_stm32::interrupt::{Interrupt, InterruptExt}; |
| 15 | use embassy_stm32::subghz::*; | 15 | use embassy_stm32::subghz::*; |
| 16 | use embassy_util::channel::signal::Signal; | 16 | use embassy_sync::channel::signal::Signal; |
| 17 | use {defmt_rtt as _, panic_probe as _}; | 17 | use {defmt_rtt as _, panic_probe as _}; |
| 18 | 18 | ||
| 19 | const PING_DATA: &str = "PING"; | 19 | const PING_DATA: &str = "PING"; |
diff --git a/examples/wasm/Cargo.toml b/examples/wasm/Cargo.toml index c7f980366..194e8f4b8 100644 --- a/examples/wasm/Cargo.toml +++ b/examples/wasm/Cargo.toml | |||
| @@ -7,7 +7,7 @@ version = "0.1.0" | |||
| 7 | crate-type = ["cdylib"] | 7 | crate-type = ["cdylib"] |
| 8 | 8 | ||
| 9 | [dependencies] | 9 | [dependencies] |
| 10 | embassy-util = { version = "0.1.0", path = "../../embassy-util", features = ["log"] } | 10 | embassy-sync = { version = "0.1.0", path = "../../embassy-sync", features = ["log"] } |
| 11 | embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["log", "wasm", "nightly", "integrated-timers"] } | 11 | embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["log", "wasm", "nightly", "integrated-timers"] } |
| 12 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["log", "wasm", "nightly"] } | 12 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["log", "wasm", "nightly"] } |
| 13 | 13 | ||
diff --git a/tests/rp/Cargo.toml b/tests/rp/Cargo.toml index 8740cc488..4d6877ccd 100644 --- a/tests/rp/Cargo.toml +++ b/tests/rp/Cargo.toml | |||
| @@ -4,7 +4,7 @@ name = "embassy-rp-tests" | |||
| 4 | version = "0.1.0" | 4 | version = "0.1.0" |
| 5 | 5 | ||
| 6 | [dependencies] | 6 | [dependencies] |
| 7 | embassy-util = { version = "0.1.0", path = "../../embassy-util", features = ["defmt"] } | 7 | embassy-sync = { version = "0.1.0", path = "../../embassy-sync", features = ["defmt"] } |
| 8 | embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "integrated-timers"] } | 8 | embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "integrated-timers"] } |
| 9 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt"] } | 9 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt"] } |
| 10 | embassy-rp = { version = "0.1.0", path = "../../embassy-rp", features = ["nightly", "defmt", "unstable-pac", "unstable-traits"] } | 10 | embassy-rp = { version = "0.1.0", path = "../../embassy-rp", features = ["nightly", "defmt", "unstable-pac", "unstable-traits"] } |
diff --git a/tests/stm32/Cargo.toml b/tests/stm32/Cargo.toml index 1d12995a2..f1441d00c 100644 --- a/tests/stm32/Cargo.toml +++ b/tests/stm32/Cargo.toml | |||
| @@ -13,7 +13,7 @@ stm32wb55rg = ["embassy-stm32/stm32wb55rg"] # Nucleo | |||
| 13 | stm32u585ai = ["embassy-stm32/stm32u585ai"] # IoT board | 13 | stm32u585ai = ["embassy-stm32/stm32u585ai"] # IoT board |
| 14 | 14 | ||
| 15 | [dependencies] | 15 | [dependencies] |
| 16 | embassy-util = { version = "0.1.0", path = "../../embassy-util", features = ["defmt"] } | 16 | embassy-sync = { version = "0.1.0", path = "../../embassy-sync", features = ["defmt"] } |
| 17 | embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "integrated-timers"] } | 17 | embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "integrated-timers"] } |
| 18 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "tick-32768hz"] } | 18 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "tick-32768hz"] } |
| 19 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "unstable-pac", "memory-x", "time-driver-tim2"] } | 19 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "unstable-pac", "memory-x", "time-driver-tim2"] } |
