diff options
Diffstat (limited to 'rtic-monotonics')
| -rw-r--r-- | rtic-monotonics/Cargo.toml | 7 | ||||
| -rw-r--r-- | rtic-monotonics/src/systick_monotonic.rs | 7 |
2 files changed, 14 insertions, 0 deletions
diff --git a/rtic-monotonics/Cargo.toml b/rtic-monotonics/Cargo.toml index 5e6586e..f94a78b 100644 --- a/rtic-monotonics/Cargo.toml +++ b/rtic-monotonics/Cargo.toml @@ -22,3 +22,10 @@ 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" } atomic-polyfill = "1" + +[features] +default = ["systick_1khz"] + +systick_100hz = [] +systick_1khz = [] +systick_10khz = [] diff --git a/rtic-monotonics/src/systick_monotonic.rs b/rtic-monotonics/src/systick_monotonic.rs index fec97f2..24deb54 100644 --- a/rtic-monotonics/src/systick_monotonic.rs +++ b/rtic-monotonics/src/systick_monotonic.rs @@ -8,8 +8,15 @@ use cortex_m::peripheral::SYST; use embedded_hal_async::delay::DelayUs; pub use fugit::ExtU32; +#[cfg(feature = "systick_100hz")] +const TIMER_HZ: u32 = 100; + +#[cfg(feature = "systick_1khz")] const TIMER_HZ: u32 = 1_000; +#[cfg(feature = "systick_10khz")] +const TIMER_HZ: u32 = 10_000; + /// Systick implementing `rtic_monotonic::Monotonic` which runs at 1 kHz. pub struct Systick; |
