Make xtask pass, clean up rtic Cargo.toml

This commit is contained in:
Emil Fresk 2023-02-02 20:14:41 +01:00
parent bf7456fdb6
commit 1c2d9de9c0
5 changed files with 31 additions and 19 deletions

View file

@ -22,3 +22,10 @@ embedded-hal-async = "0.2.0-alpha.0"
fugit = { version = "0.3.6", features = ["defmt"] } 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" }
atomic-polyfill = "1" atomic-polyfill = "1"
[features]
default = ["systick_1khz"]
systick_100hz = []
systick_1khz = []
systick_10khz = []

View file

@ -8,8 +8,15 @@ use cortex_m::peripheral::SYST;
use embedded_hal_async::delay::DelayUs; use embedded_hal_async::delay::DelayUs;
pub use fugit::ExtU32; pub use fugit::ExtU32;
#[cfg(feature = "systick_100hz")]
const TIMER_HZ: u32 = 100;
#[cfg(feature = "systick_1khz")]
const TIMER_HZ: u32 = 1_000; 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. /// Systick implementing `rtic_monotonic::Monotonic` which runs at 1 kHz.
pub struct Systick; pub struct Systick;

View file

@ -35,25 +35,23 @@ name = "rtic"
[dependencies] [dependencies]
cortex-m = "0.7.0" cortex-m = "0.7.0"
rtic-macros = { path = "macros", version = "2.0.0-alpha.0" }
rtic-monotonic = "1.0.0"
rtic-core = "1.0.0"
heapless = "0.7.7"
bare-metal = "1.0.0" bare-metal = "1.0.0"
#portable-atomic = { version = "0.3.19" } #portable-atomic = { version = "0.3.19" }
atomic-polyfill = "1" atomic-polyfill = "1"
rtic-macros = { path = "./macros", version = "2.0.0-alpha.0" }
rtic-core = "1"
[build-dependencies] [build-dependencies]
version_check = "0.9" version_check = "0.9"
[dev-dependencies] [dev-dependencies]
heapless = "0.7.7"
lm3s6965 = "0.1.3" lm3s6965 = "0.1.3"
cortex-m-semihosting = "0.5.0" cortex-m-semihosting = "0.5.0"
systick-monotonic = "1.0.0"
rtic-time = { path = "../rtic-time" } rtic-time = { path = "../rtic-time" }
rtic-channel = { path = "../rtic-channel" } rtic-channel = { path = "../rtic-channel" }
rtic-monotonics = { path = "../rtic-monotonics" } rtic-monotonics = { path = "../rtic-monotonics", default-features = false }
[dev-dependencies.futures] [dev-dependencies.futures]
version = "0.3.26" version = "0.3.26"
@ -94,7 +92,7 @@ overflow-checks = false
lm3s6965 = { git = "https://github.com/japaric/lm3s6965" } lm3s6965 = { git = "https://github.com/japaric/lm3s6965" }
[features] [features]
test-critical-section = ["cortex-m/critical-section-single-core"] test-critical-section = ["cortex-m/critical-section-single-core", "rtic-monotonics/systick_100hz"]
# [[example]] # [[example]]
# name = "pool" # name = "pool"

View file

@ -1,16 +1,16 @@
init init
the hal takes a duration of Duration { ticks: 450 } the hal takes a duration of Duration { ticks: 45 }
timeout timeout
the hal takes a duration of Duration { ticks: 450 } the hal takes a duration of Duration { ticks: 45 }
hal returned 5 hal returned 5
the hal takes a duration of Duration { ticks: 450 } the hal takes a duration of Duration { ticks: 45 }
hal returned 5 hal returned 5
now is Instant { ticks: 2102 }, timeout at Instant { ticks: 2602 } now is Instant { ticks: 210 }, timeout at Instant { ticks: 260 }
the hal takes a duration of Duration { ticks: 350 } the hal takes a duration of Duration { ticks: 35 }
hal returned 5 at time Instant { ticks: 2452 } hal returned 5 at time Instant { ticks: 245 }
now is Instant { ticks: 3102 }, timeout at Instant { ticks: 3602 } now is Instant { ticks: 310 }, timeout at Instant { ticks: 360 }
the hal takes a duration of Duration { ticks: 450 } the hal takes a duration of Duration { ticks: 45 }
hal returned 5 at time Instant { ticks: 3552 } hal returned 5 at time Instant { ticks: 355 }
now is Instant { ticks: 4102 }, timeout at Instant { ticks: 4602 } now is Instant { ticks: 410 }, timeout at Instant { ticks: 460 }
the hal takes a duration of Duration { ticks: 550 } the hal takes a duration of Duration { ticks: 55 }
timeout timeout

View file

@ -36,7 +36,7 @@
use cortex_m::{interrupt::InterruptNumber, peripheral::NVIC}; use cortex_m::{interrupt::InterruptNumber, peripheral::NVIC};
pub use rtic_core::{prelude as mutex_prelude, Exclusive, Mutex}; pub use rtic_core::{prelude as mutex_prelude, Exclusive, Mutex};
pub use rtic_macros::app; pub use rtic_macros::app;
pub use rtic_monotonic::{self, Monotonic}; // pub use rtic_monotonic::{self, Monotonic};
/// module `mutex::prelude` provides `Mutex` and multi-lock variants. Recommended over `mutex_prelude` /// module `mutex::prelude` provides `Mutex` and multi-lock variants. Recommended over `mutex_prelude`
pub mod mutex { pub mod mutex {