Split embassy crate into embassy-executor, embassy-util.
This commit is contained in:
@ -10,7 +10,7 @@ src_base_git = "https://github.com/embassy-rs/embassy/blob/$COMMIT/embassy-stm32
|
||||
# TODO: sdmmc
|
||||
# TODO: net
|
||||
# TODO: subghz
|
||||
features = ["nightly", "defmt", "unstable-pac", "unstable-traits", "exti", "time-driver-any", "embassy/time-tick-32768hz"]
|
||||
features = ["nightly", "defmt", "unstable-pac", "unstable-traits", "exti", "time-driver-any", "embassy-executor/time-tick-32768hz"]
|
||||
flavors = [
|
||||
{ regex_feature = "stm32f0.*", target = "thumbv6m-none-eabi" },
|
||||
{ regex_feature = "stm32f1.*", target = "thumbv7m-none-eabi" },
|
||||
@ -31,7 +31,8 @@ flavors = [
|
||||
]
|
||||
|
||||
[dependencies]
|
||||
embassy = { version = "0.1.0", path = "../embassy" }
|
||||
embassy-util = { version = "0.1.0", path = "../embassy-util" }
|
||||
embassy-executor = { version = "0.1.0", path = "../embassy-executor" }
|
||||
embassy-cortex-m = { version = "0.1.0", path = "../embassy-cortex-m", features = ["prio-bits-4"]}
|
||||
embassy-macros = { version = "0.1.0", path = "../embassy-macros", features = ["stm32"] }
|
||||
embassy-hal-common = {version = "0.1.0", path = "../embassy-hal-common" }
|
||||
@ -72,7 +73,7 @@ quote = "1.0.15"
|
||||
stm32-metapac = { version = "0.1.0", path = "../stm32-metapac", default-features = false, features = ["metadata"]}
|
||||
|
||||
[features]
|
||||
defmt = ["dep:defmt", "bxcan/unstable-defmt", "embassy/defmt", "embassy-embedded-hal/defmt", "embedded-io?/defmt", "embassy-usb?/defmt"]
|
||||
defmt = ["dep:defmt", "bxcan/unstable-defmt", "embassy-util/defmt", "embassy-executor/defmt", "embassy-embedded-hal/defmt", "embedded-io?/defmt", "embassy-usb?/defmt"]
|
||||
sdmmc-rs = ["embedded-sdmmc"]
|
||||
net = ["embassy-net" ]
|
||||
memory-x = ["stm32-metapac/memory-x"]
|
||||
@ -81,7 +82,7 @@ exti = []
|
||||
|
||||
# Features starting with `_` are for internal use only. They're not intended
|
||||
# to be enabled by other crates, and are not covered by semver guarantees.
|
||||
_time-driver = ["embassy/time"]
|
||||
_time-driver = ["embassy-executor/time"]
|
||||
time-driver-any = ["_time-driver"]
|
||||
time-driver-tim2 = ["_time-driver"]
|
||||
time-driver-tim3 = ["_time-driver"]
|
||||
@ -91,7 +92,7 @@ time-driver-tim12 = ["_time-driver"]
|
||||
time-driver-tim15 = ["_time-driver"]
|
||||
|
||||
# Enable nightly-only features
|
||||
nightly = ["embassy/nightly", "embedded-hal-1", "embedded-hal-async", "embedded-storage-async", "dep:embedded-io", "dep:embassy-usb", "embassy-embedded-hal/nightly"]
|
||||
nightly = ["embassy-executor/nightly", "embedded-hal-1", "embedded-hal-async", "embedded-storage-async", "dep:embedded-io", "dep:embassy-usb", "embassy-embedded-hal/nightly"]
|
||||
|
||||
# Reexport stm32-metapac at `embassy_stm32::pac`.
|
||||
# This is unstable because semver-minor (non-breaking) releases of embassy-stm32 may major-bump (breaking) the stm32-metapac version.
|
||||
|
@ -1,7 +1,7 @@
|
||||
use core::task::Poll;
|
||||
|
||||
use embassy::waitqueue::AtomicWaker;
|
||||
use embassy_hal_common::{into_ref, PeripheralRef};
|
||||
use embassy_util::waitqueue::AtomicWaker;
|
||||
use futures::future::poll_fn;
|
||||
|
||||
use crate::gpio::sealed::AFType;
|
||||
|
@ -3,7 +3,7 @@
|
||||
use core::sync::atomic::{fence, Ordering};
|
||||
use core::task::Waker;
|
||||
|
||||
use embassy::waitqueue::AtomicWaker;
|
||||
use embassy_util::waitqueue::AtomicWaker;
|
||||
|
||||
use super::{TransferOptions, Word, WordSize};
|
||||
use crate::_generated::BDMA_CHANNEL_COUNT;
|
||||
|
@ -1,7 +1,7 @@
|
||||
use core::sync::atomic::{fence, Ordering};
|
||||
use core::task::Waker;
|
||||
|
||||
use embassy::waitqueue::AtomicWaker;
|
||||
use embassy_util::waitqueue::AtomicWaker;
|
||||
|
||||
use super::{Burst, FlowControl, Request, TransferOptions, Word, WordSize};
|
||||
use crate::_generated::DMA_CHANNEL_COUNT;
|
||||
|
@ -1,7 +1,7 @@
|
||||
use core::sync::atomic::{fence, Ordering};
|
||||
use core::task::Waker;
|
||||
|
||||
use embassy::waitqueue::AtomicWaker;
|
||||
use embassy_util::waitqueue::AtomicWaker;
|
||||
|
||||
use super::{Request, TransferOptions, Word, WordSize};
|
||||
use crate::_generated::GPDMA_CHANNEL_COUNT;
|
||||
|
@ -4,10 +4,10 @@ use core::marker::PhantomData;
|
||||
use core::sync::atomic::{fence, Ordering};
|
||||
use core::task::Waker;
|
||||
|
||||
use embassy::waitqueue::AtomicWaker;
|
||||
use embassy_cortex_m::peripheral::{PeripheralMutex, PeripheralState, StateStorage};
|
||||
use embassy_hal_common::{into_ref, PeripheralRef};
|
||||
use embassy_net::{Device, DeviceCapabilities, LinkState, PacketBuf, MTU};
|
||||
use embassy_util::waitqueue::AtomicWaker;
|
||||
|
||||
use crate::gpio::sealed::{AFType, Pin as __GpioPin};
|
||||
use crate::gpio::{AnyPin, Speed};
|
||||
|
@ -2,10 +2,10 @@ use core::marker::PhantomData;
|
||||
use core::sync::atomic::{fence, Ordering};
|
||||
use core::task::Waker;
|
||||
|
||||
use embassy::waitqueue::AtomicWaker;
|
||||
use embassy_cortex_m::peripheral::{PeripheralMutex, PeripheralState, StateStorage};
|
||||
use embassy_hal_common::{into_ref, PeripheralRef};
|
||||
use embassy_net::{Device, DeviceCapabilities, LinkState, PacketBuf, MTU};
|
||||
use embassy_util::waitqueue::AtomicWaker;
|
||||
|
||||
use crate::gpio::sealed::{AFType, Pin as _};
|
||||
use crate::gpio::{AnyPin, Speed};
|
||||
|
@ -3,8 +3,8 @@ use core::marker::PhantomData;
|
||||
use core::pin::Pin;
|
||||
use core::task::{Context, Poll};
|
||||
|
||||
use embassy::waitqueue::AtomicWaker;
|
||||
use embassy_hal_common::impl_peripheral;
|
||||
use embassy_util::waitqueue::AtomicWaker;
|
||||
|
||||
use crate::gpio::{AnyPin, Input, Pin as GpioPin};
|
||||
use crate::pac::exti::regs::Lines;
|
||||
|
@ -2,10 +2,10 @@ use core::cmp;
|
||||
use core::task::Poll;
|
||||
|
||||
use atomic_polyfill::{AtomicUsize, Ordering};
|
||||
use embassy::waitqueue::AtomicWaker;
|
||||
use embassy_embedded_hal::SetConfig;
|
||||
use embassy_hal_common::drop::OnDrop;
|
||||
use embassy_hal_common::{into_ref, PeripheralRef};
|
||||
use embassy_util::waitqueue::AtomicWaker;
|
||||
use futures::future::poll_fn;
|
||||
|
||||
use crate::dma::NoDma;
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
use core::task::Poll;
|
||||
|
||||
use embassy::waitqueue::AtomicWaker;
|
||||
use embassy_hal_common::{into_ref, PeripheralRef};
|
||||
use embassy_util::waitqueue::AtomicWaker;
|
||||
use futures::future::poll_fn;
|
||||
use rand_core::{CryptoRng, RngCore};
|
||||
|
||||
|
@ -3,9 +3,9 @@
|
||||
use core::default::Default;
|
||||
use core::task::Poll;
|
||||
|
||||
use embassy::waitqueue::AtomicWaker;
|
||||
use embassy_hal_common::drop::OnDrop;
|
||||
use embassy_hal_common::{into_ref, PeripheralRef};
|
||||
use embassy_util::waitqueue::AtomicWaker;
|
||||
use futures::future::poll_fn;
|
||||
use sdio_host::{BusWidth, CardCapacity, CardStatus, CurrentState, SDStatus, CID, CSD, OCR, SCR};
|
||||
|
||||
@ -1507,8 +1507,8 @@ foreach_peripheral!(
|
||||
INNER
|
||||
}
|
||||
|
||||
fn state() -> &'static ::embassy::waitqueue::AtomicWaker {
|
||||
static WAKER: ::embassy::waitqueue::AtomicWaker = ::embassy::waitqueue::AtomicWaker::new();
|
||||
fn state() -> &'static ::embassy_util::waitqueue::AtomicWaker {
|
||||
static WAKER: ::embassy_util::waitqueue::AtomicWaker = ::embassy_util::waitqueue::AtomicWaker::new();
|
||||
&WAKER
|
||||
}
|
||||
}
|
||||
|
@ -504,7 +504,7 @@ impl<'d> SubGhz<'d, NoDma, NoDma> {
|
||||
///
|
||||
/// sg.set_standby(StandbyClk::Rc)?;
|
||||
/// unsafe { sg.set_sleep(SleepCfg::default())? };
|
||||
/// embassy::time::Timer::after(embassy::time::Duration::from_micros(500)).await;
|
||||
/// embassy_executor::time::Timer::after(embassy_executor::time::Duration::from_micros(500)).await;
|
||||
/// unsafe { wakeup() };
|
||||
/// # Ok::<(), embassy_stm32::subghz::Error>(())
|
||||
/// ```
|
||||
|
@ -439,9 +439,9 @@ impl From<Timeout> for [u8; 3] {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<Timeout> for embassy::time::Duration {
|
||||
impl From<Timeout> for embassy_executor::time::Duration {
|
||||
fn from(to: Timeout) -> Self {
|
||||
embassy::time::Duration::from_micros(to.as_micros().into())
|
||||
embassy_executor::time::Duration::from_micros(to.as_micros().into())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -44,17 +44,17 @@ impl From<RampTime> for core::time::Duration {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<RampTime> for embassy::time::Duration {
|
||||
impl From<RampTime> for embassy_executor::time::Duration {
|
||||
fn from(rt: RampTime) -> Self {
|
||||
match rt {
|
||||
RampTime::Micros10 => embassy::time::Duration::from_micros(10),
|
||||
RampTime::Micros20 => embassy::time::Duration::from_micros(20),
|
||||
RampTime::Micros40 => embassy::time::Duration::from_micros(40),
|
||||
RampTime::Micros80 => embassy::time::Duration::from_micros(80),
|
||||
RampTime::Micros200 => embassy::time::Duration::from_micros(200),
|
||||
RampTime::Micros800 => embassy::time::Duration::from_micros(800),
|
||||
RampTime::Micros1700 => embassy::time::Duration::from_micros(1700),
|
||||
RampTime::Micros3400 => embassy::time::Duration::from_micros(3400),
|
||||
RampTime::Micros10 => embassy_executor::time::Duration::from_micros(10),
|
||||
RampTime::Micros20 => embassy_executor::time::Duration::from_micros(20),
|
||||
RampTime::Micros40 => embassy_executor::time::Duration::from_micros(40),
|
||||
RampTime::Micros80 => embassy_executor::time::Duration::from_micros(80),
|
||||
RampTime::Micros200 => embassy_executor::time::Duration::from_micros(200),
|
||||
RampTime::Micros800 => embassy_executor::time::Duration::from_micros(800),
|
||||
RampTime::Micros1700 => embassy_executor::time::Duration::from_micros(1700),
|
||||
RampTime::Micros3400 => embassy_executor::time::Duration::from_micros(3400),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,10 +4,10 @@ use core::sync::atomic::{compiler_fence, Ordering};
|
||||
use core::{mem, ptr};
|
||||
|
||||
use atomic_polyfill::{AtomicU32, AtomicU8};
|
||||
use embassy::blocking_mutex::raw::CriticalSectionRawMutex;
|
||||
use embassy::blocking_mutex::Mutex;
|
||||
use embassy::time::driver::{AlarmHandle, Driver};
|
||||
use embassy::time::TICKS_PER_SECOND;
|
||||
use embassy_executor::time::driver::{AlarmHandle, Driver};
|
||||
use embassy_executor::time::TICKS_PER_SECOND;
|
||||
use embassy_util::blocking_mutex::raw::CriticalSectionRawMutex;
|
||||
use embassy_util::blocking_mutex::Mutex;
|
||||
use stm32_metapac::timer::regs;
|
||||
|
||||
use crate::interrupt::{CriticalSection, InterruptExt};
|
||||
@ -133,7 +133,7 @@ struct RtcDriver {
|
||||
|
||||
const ALARM_STATE_NEW: AlarmState = AlarmState::new();
|
||||
|
||||
embassy::time_driver_impl!(static DRIVER: RtcDriver = RtcDriver {
|
||||
embassy_executor::time_driver_impl!(static DRIVER: RtcDriver = RtcDriver {
|
||||
period: AtomicU32::new(0),
|
||||
alarm_count: AtomicU8::new(0),
|
||||
alarms: Mutex::const_new(CriticalSectionRawMutex::new(), [ALARM_STATE_NEW; ALARM_COUNT]),
|
||||
|
@ -2,9 +2,9 @@ use core::future::Future;
|
||||
use core::task::Poll;
|
||||
|
||||
use atomic_polyfill::{compiler_fence, Ordering};
|
||||
use embassy::waitqueue::WakerRegistration;
|
||||
use embassy_cortex_m::peripheral::{PeripheralMutex, PeripheralState, StateStorage};
|
||||
use embassy_hal_common::ring_buffer::RingBuffer;
|
||||
use embassy_util::waitqueue::WakerRegistration;
|
||||
use futures::future::poll_fn;
|
||||
|
||||
use super::*;
|
||||
|
@ -5,11 +5,11 @@ use core::sync::atomic::Ordering;
|
||||
use core::task::Poll;
|
||||
|
||||
use atomic_polyfill::{AtomicBool, AtomicU8};
|
||||
use embassy::time::{block_for, Duration};
|
||||
use embassy::waitqueue::AtomicWaker;
|
||||
use embassy_executor::time::{block_for, Duration};
|
||||
use embassy_hal_common::into_ref;
|
||||
use embassy_usb::driver::{self, EndpointAllocError, EndpointError, Event, Unsupported};
|
||||
use embassy_usb::types::{EndpointAddress, EndpointInfo, EndpointType, UsbDirection};
|
||||
use embassy_util::waitqueue::AtomicWaker;
|
||||
use futures::future::poll_fn;
|
||||
use futures::Future;
|
||||
use pac::common::{Reg, RW};
|
||||
|
Reference in New Issue
Block a user