mirror of
https://github.com/rtic-rs/rtic.git
synced 2024-11-23 20:22:51 +01:00
CFG: Align all crates to use hyphen
This commit is contained in:
parent
5dc2c1d351
commit
44af136605
6 changed files with 20 additions and 20 deletions
|
@ -30,9 +30,9 @@ default = []
|
|||
defmt = ["fugit/defmt"]
|
||||
|
||||
# Systick on Cortex-M, default 1 kHz
|
||||
cortex_m_systick = ["dep:cortex-m"]
|
||||
systick_100hz = []
|
||||
systick_10khz = []
|
||||
cortex-m-systick = ["dep:cortex-m"]
|
||||
systick-100hz = []
|
||||
systick-10khz = []
|
||||
|
||||
# Timer peripheral on the RP2040
|
||||
rp2040 = ["dep:rp2040-pac"]
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
pub use rtic_time::{Monotonic, TimeoutError, TimerQueue};
|
||||
|
||||
#[cfg(feature = "cortex_m_systick")]
|
||||
#[cfg(feature = "cortex-m-systick")]
|
||||
pub mod systick;
|
||||
|
||||
#[cfg(feature = "rp2040")]
|
||||
|
|
|
@ -7,14 +7,14 @@ use core::future::Future;
|
|||
use cortex_m::peripheral::SYST;
|
||||
pub use fugit::ExtU32;
|
||||
|
||||
// Features should be additive, here systick_100hz gets picked if both
|
||||
// `systick_100hz` and `systick_10khz` are enabled.
|
||||
// Features should be additive, here systick-100hz gets picked if both
|
||||
// `systick-100hz` and `systick-10khz` are enabled.
|
||||
|
||||
cfg_if::cfg_if! {
|
||||
if #[cfg(feature = "systick_100hz")]
|
||||
if #[cfg(feature = "systick-100hz")]
|
||||
{
|
||||
const TIMER_HZ: u32 = 100;
|
||||
} else if #[cfg(feature = "systick_10khz")]
|
||||
} else if #[cfg(feature = "systick-10khz")]
|
||||
{
|
||||
const TIMER_HZ: u32 = 10_000;
|
||||
} else {
|
||||
|
|
|
@ -48,7 +48,7 @@ lm3s6965 = "0.1.3"
|
|||
cortex-m-semihosting = "0.5.0"
|
||||
rtic-time = { path = "../rtic-time" }
|
||||
rtic-sync = { path = "../rtic-sync" }
|
||||
rtic-monotonics = { path = "../rtic-monotonics", features = ["cortex_m_systick"] }
|
||||
rtic-monotonics = { path = "../rtic-monotonics", features = ["cortex-m-systick"] }
|
||||
|
||||
[dev-dependencies.futures]
|
||||
version = "0.3.26"
|
||||
|
@ -74,7 +74,7 @@ thumbv8main-backend = ["rtic-macros/cortex-m-basepri"]
|
|||
# riscv-esp32c3-backend = ["rtic-macros/riscv-esp32c3"]
|
||||
|
||||
# needed for testing
|
||||
test-critical-section = ["cortex-m/critical-section-single-core", "rtic-monotonics/systick_100hz"]
|
||||
test-critical-section = ["cortex-m/critical-section-single-core", "rtic-monotonics/systick-100hz"]
|
||||
|
||||
# [[example]]
|
||||
# name = "pool"
|
||||
|
|
|
@ -8,14 +8,14 @@ fn main() {
|
|||
| target.starts_with("thumbv7em")
|
||||
| target.starts_with("thumbv8m.main")
|
||||
{
|
||||
println!("cargo:rustc-cfg=cortex_m_basepri");
|
||||
println!("cargo:rustc-cfg=feature=\"cortex-m-basepri\"");
|
||||
} else if target.starts_with("thumbv6m") | target.starts_with("thumbv8m.base") {
|
||||
println!("cargo:rustc-cfg=cortex_m_source_masking");
|
||||
println!("cargo:rustc-cfg=feature=\"cortex-m-source-masking\"");
|
||||
} else if target.starts_with("riscv32i") {
|
||||
panic!("No RISC-V support yet.");
|
||||
|
||||
// TODO: Add feature here for risc-v targets
|
||||
// println!("cargo:rustc-cfg=riscv");
|
||||
// println!("cargo:rustc-cfg=feature=\"riscv\"");
|
||||
} else if target.starts_with("thumb") || target.starts_with("riscv32") {
|
||||
panic!("Unknown target '{target}'. Need to update logic in build.rs.");
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ pub use atomic_polyfill as atomic;
|
|||
pub mod executor;
|
||||
|
||||
#[cfg(all(
|
||||
cortex_m_basepri,
|
||||
feature = "cortex-m-basepri",
|
||||
not(any(feature = "thumbv7-backend", feature = "thumbv8main-backend"))
|
||||
))]
|
||||
compile_error!(
|
||||
|
@ -13,27 +13,27 @@ compile_error!(
|
|||
);
|
||||
|
||||
#[cfg(all(
|
||||
cortex_m_source_masking,
|
||||
feature = "cortex-m-source-masking",
|
||||
not(any(feature = "thumbv6-backend", feature = "thumbv8base-backend"))
|
||||
))]
|
||||
compile_error!(
|
||||
"Building for Cortex-M with source masking, but 'thumbv6-backend' or 'thumbv8base-backend' backend not selected"
|
||||
);
|
||||
|
||||
#[cfg(cortex_m_basepri)]
|
||||
#[cfg(any(feature = "cortex-m-basepri"))]
|
||||
pub use cortex_basepri::*;
|
||||
|
||||
#[cfg(cortex_m_basepri)]
|
||||
#[cfg(any(feature = "cortex-m-basepri"))]
|
||||
mod cortex_basepri;
|
||||
|
||||
#[cfg(cortex_m_source_masking)]
|
||||
#[cfg(feature = "cortex-m-source-masking")]
|
||||
pub use cortex_source_mask::*;
|
||||
|
||||
#[cfg(cortex_m_source_masking)]
|
||||
#[cfg(feature = "cortex-m-source-masking")]
|
||||
mod cortex_source_mask;
|
||||
|
||||
/// Priority conversion, takes logical priorities 1..=N and converts it to NVIC priority.
|
||||
#[cfg(any(cortex_m_basepri, cortex_m_source_masking))]
|
||||
#[cfg(any(feature = "cortex-m-basepri", feature = "cortex-m-source-masking",))]
|
||||
#[inline]
|
||||
#[must_use]
|
||||
pub const fn cortex_logical2hw(logical: u8, nvic_prio_bits: u8) -> u8 {
|
||||
|
|
Loading…
Reference in a new issue