mirror of
https://github.com/rtic-rs/rtic.git
synced 2024-12-01 16:04:33 +01:00
rtic-monotonics: Feature gate monotonics correctly to support multiple MCUs
This commit is contained in:
parent
8963e0e27a
commit
b566a89393
3 changed files with 9 additions and 4 deletions
|
@ -17,18 +17,22 @@ license = "MIT OR Apache-2.0"
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
cortex-m = { version = "0.7.6" }
|
|
||||||
embedded-hal-async = "0.2.0-alpha.0"
|
|
||||||
fugit = { version = "0.3.6", features = ["defmt"] }
|
|
||||||
rtic-time = { version = "1.0.0-alpha.0", path = "../rtic-time" }
|
rtic-time = { version = "1.0.0-alpha.0", path = "../rtic-time" }
|
||||||
|
embedded-hal-async = "0.2.0-alpha.0"
|
||||||
|
fugit = { version = "0.3.6" }
|
||||||
atomic-polyfill = "1"
|
atomic-polyfill = "1"
|
||||||
cfg-if = "1.0.0"
|
cfg-if = "1.0.0"
|
||||||
|
cortex-m = { version = "0.7.6", optional = true }
|
||||||
rp2040-pac = { version = ">=0.2.0,<0.5", optional = true }
|
rp2040-pac = { version = ">=0.2.0,<0.5", optional = true }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = []
|
default = []
|
||||||
|
defmt = ["fugit/defmt"]
|
||||||
|
|
||||||
|
# Systick on Cortex-M, default 1 kHz
|
||||||
|
cortex_m_systick = ["dep:cortex-m"]
|
||||||
systick_100hz = []
|
systick_100hz = []
|
||||||
systick_10khz = []
|
systick_10khz = []
|
||||||
|
|
||||||
|
# Timer peripheral on the RP2040
|
||||||
rp2040 = ["dep:rp2040-pac"]
|
rp2040 = ["dep:rp2040-pac"]
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
|
|
||||||
pub use rtic_time::{Monotonic, TimeoutError, TimerQueue};
|
pub use rtic_time::{Monotonic, TimeoutError, TimerQueue};
|
||||||
|
|
||||||
|
#[cfg(feature = "cortex_m_sytick")]
|
||||||
pub mod systick;
|
pub mod systick;
|
||||||
|
|
||||||
#[cfg(feature = "rp2040")]
|
#[cfg(feature = "rp2040")]
|
||||||
|
|
|
@ -106,7 +106,7 @@ impl Monotonic for Timer {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn pend_interrupt() {
|
fn pend_interrupt() {
|
||||||
cortex_m::peripheral::NVIC::pend(Interrupt::TIMER_IRQ_0);
|
rp2040_pac::NVIC::pend(Interrupt::TIMER_IRQ_0);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn on_interrupt() {}
|
fn on_interrupt() {}
|
||||||
|
|
Loading…
Reference in a new issue