Split embassy-time from embassy-executor.
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-executor/time-tick-32768hz"]
|
||||
features = ["nightly", "defmt", "unstable-pac", "unstable-traits", "exti", "time-driver-any", "embassy-time/tick-32768hz"]
|
||||
flavors = [
|
||||
{ regex_feature = "stm32f0.*", target = "thumbv6m-none-eabi" },
|
||||
{ regex_feature = "stm32f1.*", target = "thumbv7m-none-eabi" },
|
||||
@ -33,6 +33,7 @@ flavors = [
|
||||
[dependencies]
|
||||
embassy-util = { version = "0.1.0", path = "../embassy-util" }
|
||||
embassy-executor = { version = "0.1.0", path = "../embassy-executor" }
|
||||
embassy-time = { version = "0.1.0", path = "../embassy-time", optional = true }
|
||||
embassy-cortex-m = { version = "0.1.0", path = "../embassy-cortex-m", features = ["prio-bits-4"]}
|
||||
embassy-hal-common = {version = "0.1.0", path = "../embassy-hal-common" }
|
||||
embassy-embedded-hal = {version = "0.1.0", path = "../embassy-embedded-hal" }
|
||||
@ -80,7 +81,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-executor/time"]
|
||||
_time-driver = ["dep:embassy-time"]
|
||||
time-driver-any = ["_time-driver"]
|
||||
time-driver-tim2 = ["_time-driver"]
|
||||
time-driver-tim3 = ["_time-driver"]
|
||||
|
@ -504,7 +504,7 @@ impl<'d> SubGhz<'d, NoDma, NoDma> {
|
||||
///
|
||||
/// sg.set_standby(StandbyClk::Rc)?;
|
||||
/// unsafe { sg.set_sleep(SleepCfg::default())? };
|
||||
/// embassy_executor::time::Timer::after(embassy_executor::time::Duration::from_micros(500)).await;
|
||||
/// embassy_time::Timer::after(embassy_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_executor::time::Duration {
|
||||
impl From<Timeout> for embassy_time::Duration {
|
||||
fn from(to: Timeout) -> Self {
|
||||
embassy_executor::time::Duration::from_micros(to.as_micros().into())
|
||||
embassy_time::Duration::from_micros(to.as_micros().into())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -44,17 +44,17 @@ impl From<RampTime> for core::time::Duration {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<RampTime> for embassy_executor::time::Duration {
|
||||
impl From<RampTime> for embassy_time::Duration {
|
||||
fn from(rt: RampTime) -> Self {
|
||||
match rt {
|
||||
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),
|
||||
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),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,8 +4,8 @@ use core::sync::atomic::{compiler_fence, Ordering};
|
||||
use core::{mem, ptr};
|
||||
|
||||
use atomic_polyfill::{AtomicU32, AtomicU8};
|
||||
use embassy_executor::time::driver::{AlarmHandle, Driver};
|
||||
use embassy_executor::time::TICKS_PER_SECOND;
|
||||
use embassy_time::driver::{AlarmHandle, Driver};
|
||||
use embassy_time::TICKS_PER_SECOND;
|
||||
use embassy_util::blocking_mutex::raw::CriticalSectionRawMutex;
|
||||
use embassy_util::blocking_mutex::Mutex;
|
||||
use stm32_metapac::timer::regs;
|
||||
@ -133,7 +133,7 @@ struct RtcDriver {
|
||||
|
||||
const ALARM_STATE_NEW: AlarmState = AlarmState::new();
|
||||
|
||||
embassy_executor::time_driver_impl!(static DRIVER: RtcDriver = RtcDriver {
|
||||
embassy_time::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]),
|
||||
|
@ -5,8 +5,8 @@ use core::sync::atomic::Ordering;
|
||||
use core::task::Poll;
|
||||
|
||||
use atomic_polyfill::{AtomicBool, AtomicU8};
|
||||
use embassy_executor::time::{block_for, Duration};
|
||||
use embassy_hal_common::into_ref;
|
||||
use embassy_time::{block_for, Duration};
|
||||
use embassy_usb::driver::{self, EndpointAllocError, EndpointError, Event, Unsupported};
|
||||
use embassy_usb::types::{EndpointAddress, EndpointInfo, EndpointType, UsbDirection};
|
||||
use embassy_util::waitqueue::AtomicWaker;
|
||||
|
Reference in New Issue
Block a user