aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmil Fresk <emil.fresk@gmail.com>2023-02-02 20:14:41 +0100
committerHenrik Tjäder <henrik@tjaders.com>2023-03-01 00:35:11 +0100
commit82f2f0834943cd7f69130f30904f4372d39f92e7 (patch)
tree3cc50a74ec6e6cd787890fd2863b60b94e839fd2
parent0f5178a48fd29252df2bb41e30a36fc18a5bcf52 (diff)
Make xtask pass, clean up rtic Cargo.toml
-rw-r--r--rtic-monotonics/Cargo.toml7
-rw-r--r--rtic-monotonics/src/systick_monotonic.rs7
-rw-r--r--rtic/Cargo.toml12
-rw-r--r--rtic/ci/expected/async-timeout.run22
-rw-r--r--rtic/src/lib.rs2
5 files changed, 31 insertions, 19 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;
diff --git a/rtic/Cargo.toml b/rtic/Cargo.toml
index 7bca4c1..d722e65 100644
--- a/rtic/Cargo.toml
+++ b/rtic/Cargo.toml
@@ -35,25 +35,23 @@ name = "rtic"
[dependencies]
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"
#portable-atomic = { version = "0.3.19" }
atomic-polyfill = "1"
+rtic-macros = { path = "./macros", version = "2.0.0-alpha.0" }
+rtic-core = "1"
[build-dependencies]
version_check = "0.9"
[dev-dependencies]
+heapless = "0.7.7"
lm3s6965 = "0.1.3"
cortex-m-semihosting = "0.5.0"
-systick-monotonic = "1.0.0"
rtic-time = { path = "../rtic-time" }
rtic-channel = { path = "../rtic-channel" }
-rtic-monotonics = { path = "../rtic-monotonics" }
+rtic-monotonics = { path = "../rtic-monotonics", default-features = false }
[dev-dependencies.futures]
version = "0.3.26"
@@ -94,7 +92,7 @@ overflow-checks = false
lm3s6965 = { git = "https://github.com/japaric/lm3s6965" }
[features]
-test-critical-section = ["cortex-m/critical-section-single-core"]
+test-critical-section = ["cortex-m/critical-section-single-core", "rtic-monotonics/systick_100hz"]
# [[example]]
# name = "pool"
diff --git a/rtic/ci/expected/async-timeout.run b/rtic/ci/expected/async-timeout.run
index ca929c7..dea8e5d 100644
--- a/rtic/ci/expected/async-timeout.run
+++ b/rtic/ci/expected/async-timeout.run
@@ -1,16 +1,16 @@
init
-the hal takes a duration of Duration { ticks: 450 }
+the hal takes a duration of Duration { ticks: 45 }
timeout
-the hal takes a duration of Duration { ticks: 450 }
+the hal takes a duration of Duration { ticks: 45 }
hal returned 5
-the hal takes a duration of Duration { ticks: 450 }
+the hal takes a duration of Duration { ticks: 45 }
hal returned 5
-now is Instant { ticks: 2102 }, timeout at Instant { ticks: 2602 }
-the hal takes a duration of Duration { ticks: 350 }
-hal returned 5 at time Instant { ticks: 2452 }
-now is Instant { ticks: 3102 }, timeout at Instant { ticks: 3602 }
-the hal takes a duration of Duration { ticks: 450 }
-hal returned 5 at time Instant { ticks: 3552 }
-now is Instant { ticks: 4102 }, timeout at Instant { ticks: 4602 }
-the hal takes a duration of Duration { ticks: 550 }
+now is Instant { ticks: 210 }, timeout at Instant { ticks: 260 }
+the hal takes a duration of Duration { ticks: 35 }
+hal returned 5 at time Instant { ticks: 245 }
+now is Instant { ticks: 310 }, timeout at Instant { ticks: 360 }
+the hal takes a duration of Duration { ticks: 45 }
+hal returned 5 at time Instant { ticks: 355 }
+now is Instant { ticks: 410 }, timeout at Instant { ticks: 460 }
+the hal takes a duration of Duration { ticks: 55 }
timeout
diff --git a/rtic/src/lib.rs b/rtic/src/lib.rs
index 860e743..a193e5c 100644
--- a/rtic/src/lib.rs
+++ b/rtic/src/lib.rs
@@ -36,7 +36,7 @@
use cortex_m::{interrupt::InterruptNumber, peripheral::NVIC};
pub use rtic_core::{prelude as mutex_prelude, Exclusive, Mutex};
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`
pub mod mutex {