Implement time feature
This commit is contained in:
@ -7,7 +7,9 @@ use crate::interrupt::Interrupt;
|
||||
mod _version;
|
||||
pub use _version::*;
|
||||
|
||||
#[cfg(feature = "time")]
|
||||
mod timeout;
|
||||
#[cfg(feature = "time")]
|
||||
pub use timeout::*;
|
||||
|
||||
use crate::peripherals;
|
||||
|
@ -52,7 +52,7 @@ pub mod sdmmc;
|
||||
pub mod spi;
|
||||
#[cfg(usart)]
|
||||
pub mod usart;
|
||||
#[cfg(usb)]
|
||||
#[cfg(all(usb, feature = "time"))]
|
||||
pub mod usb;
|
||||
#[cfg(any(otgfs, otghs))]
|
||||
pub mod usb_otg;
|
||||
|
@ -439,6 +439,7 @@ impl From<Timeout> for [u8; 3] {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "time")]
|
||||
impl From<Timeout> for embassy_time::Duration {
|
||||
fn from(to: Timeout) -> Self {
|
||||
embassy_time::Duration::from_micros(to.as_micros().into())
|
||||
|
@ -44,6 +44,7 @@ impl From<RampTime> for core::time::Duration {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "time")]
|
||||
impl From<RampTime> for embassy_time::Duration {
|
||||
fn from(rt: RampTime) -> Self {
|
||||
match rt {
|
||||
|
Reference in New Issue
Block a user