mirror of
https://github.com/rtic-rs/rtic.git
synced 2024-11-29 15:04:32 +01:00
incr: making embedded-hal optional
This commit is contained in:
parent
52aa56e265
commit
5a59e1449d
5 changed files with 19 additions and 10 deletions
|
@ -4,12 +4,12 @@ version = "1.2.0"
|
|||
|
||||
edition = "2021"
|
||||
authors = [
|
||||
"The Real-Time Interrupt-driven Concurrency developers",
|
||||
"Emil Fresk <emil.fresk@gmail.com>",
|
||||
"Henrik Tjäder <henrik@tjaders.com>",
|
||||
"Jorge Aparicio <jorge@japaric.io>",
|
||||
"Per Lindgren <per.lindgren@ltu.se>",
|
||||
"Andres Vahter <andres@vahter.me>",
|
||||
"The Real-Time Interrupt-driven Concurrency developers",
|
||||
"Emil Fresk <emil.fresk@gmail.com>",
|
||||
"Henrik Tjäder <henrik@tjaders.com>",
|
||||
"Jorge Aparicio <jorge@japaric.io>",
|
||||
"Per Lindgren <per.lindgren@ltu.se>",
|
||||
"Andres Vahter <andres@vahter.me>",
|
||||
]
|
||||
categories = ["concurrency", "embedded", "no-std", "asynchronous"]
|
||||
description = "A library that provides implementations of the Monotonic trait from rtic-time"
|
||||
|
@ -21,14 +21,15 @@ rustdoc-flags = ["--cfg", "docsrs"]
|
|||
|
||||
[dependencies]
|
||||
rtic-time = { version = "1.0.0", path = "../rtic-time" }
|
||||
embedded-hal = { version = "1.0.0-rc.1" }
|
||||
embedded-hal-async = { version = "1.0.0-rc.1", optional = true }
|
||||
fugit = { version = "0.3.6" }
|
||||
atomic-polyfill = "1"
|
||||
cfg-if = "1.0.0"
|
||||
cortex-m = { version = "0.7.6", optional = true }
|
||||
critical-section = { version = "1", optional = true }
|
||||
|
||||
embedded-hal = { version = "1.0.0-rc.1", optional = true }
|
||||
embedded-hal-async = { version = "1.0.0-rc.1", optional = true }
|
||||
|
||||
# RP2040
|
||||
rp2040-pac = { version = ">=0.2.0,<0.6", optional = true }
|
||||
|
||||
|
@ -48,11 +49,15 @@ stm32-metapac = { version = "14.0.0", optional = true }
|
|||
[build-dependencies]
|
||||
proc-macro2 = { version = "1.0.36", optional = true }
|
||||
quote = { version = "1.0.15", optional = true }
|
||||
stm32-metapac = { version = "14.0.0", default-features = false, features = ["metadata"], optional = true }
|
||||
stm32-metapac = { version = "14.0.0", default-features = false, features = [
|
||||
"metadata",
|
||||
], optional = true }
|
||||
|
||||
[features]
|
||||
default = []
|
||||
default = ["embedded-hal"]
|
||||
defmt = ["fugit/defmt"]
|
||||
embedded-hal = ["dep:embedded-hal"]
|
||||
embedded-hal-async = ["dep:embedded-hal-async"]
|
||||
|
||||
# Systick on Cortex-M, default 1 kHz
|
||||
cortex-m-systick = ["dep:cortex-m"]
|
||||
|
|
|
@ -180,6 +180,7 @@ macro_rules! make_rtc {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "embedded-hal")]
|
||||
impl embedded_hal::delay::DelayUs for $mono_name {
|
||||
fn delay_us(&mut self, us: u32) {
|
||||
let done = Self::now() + u64::from(us).micros();
|
||||
|
|
|
@ -216,6 +216,7 @@ macro_rules! make_timer {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "embedded-hal")]
|
||||
impl embedded_hal::delay::DelayUs for $mono_name {
|
||||
fn delay_us(&mut self, us: u32) {
|
||||
let done = Self::now() + (us as u64).micros();
|
||||
|
|
|
@ -162,6 +162,7 @@ impl embedded_hal_async::delay::DelayUs for Timer {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "embedded-hal")]
|
||||
impl embedded_hal::delay::DelayUs for Timer {
|
||||
fn delay_us(&mut self, us: u32) {
|
||||
let done = Self::now() + u64::from(us).micros();
|
||||
|
|
|
@ -231,6 +231,7 @@ macro_rules! make_timer {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "embedded-hal")]
|
||||
impl embedded_hal::delay::DelayUs for $mono_name {
|
||||
fn delay_us(&mut self, us: u32) {
|
||||
let done = Self::now() + (us as u64).micros();
|
||||
|
|
Loading…
Reference in a new issue