Monotonic rewrite (#874)

* Rework timer_queue and monotonic architecture

Goals:
 * make Monotonic purely internal
 * make Monotonic purely tick passed, no fugit involved
 * create a wrapper struct in the user's code via a macro that then
   converts the "now" from the tick based monotonic to a fugit based
   timestamp

We need to proxy the delay functions of the timer queue anyway,
so we could simply perform the conversion in those proxy functions.

* Update cargo.lock

* Update readme of rtic-time

* CI: ESP32: Redact esp_image: Too volatile

* Fixup: Changelog double entry rebase mistake

---------

Co-authored-by: Henrik Tjäder <henrik@tjaders.com>
This commit is contained in:
Finomnis 2024-04-11 00:00:38 +02:00 committed by GitHub
parent e4cc5fd17b
commit 8c23e178f3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
54 changed files with 2637 additions and 1676 deletions

View file

@ -133,9 +133,18 @@ dependencies = [
[[package]]
name = "embedded-hal"
version = "1.0.0-rc.2"
version = "1.0.0-rc.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3e57ec6ad0bc8eb967cf9c9f144177f5e8f2f6f02dad0b8b683f9f05f6b22def"
checksum = "bc402f79e1fd22731ca945b4f97b5ff37e7b3f379312595c42bb2e8811c29920"
[[package]]
name = "embedded-hal-async"
version = "1.0.0-rc.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fa1fba2ef2ffb35d614acc6fb323ddf7facc45c069f24544d49ea54e5043626d"
dependencies = [
"embedded-hal 1.0.0-rc.3",
]
[[package]]
name = "equivalent"
@ -440,12 +449,12 @@ dependencies = [
[[package]]
name = "rtic-monotonics"
version = "1.4.0"
version = "2.0.0"
dependencies = [
"atomic-polyfill",
"cfg-if",
"cortex-m",
"embedded-hal 1.0.0-rc.2",
"embedded-hal 1.0.0-rc.3",
"fugit",
"imxrt-ral",
"rtic-time",
@ -453,9 +462,12 @@ dependencies = [
[[package]]
name = "rtic-time"
version = "1.1.0"
version = "2.0.0"
dependencies = [
"critical-section",
"embedded-hal 1.0.0-rc.3",
"embedded-hal-async",
"fugit",
"futures-util",
"rtic-common",
]

View file

@ -14,7 +14,7 @@ features = ["thumbv7-backend"]
[dependencies.rtic-monotonics]
path = "../../rtic-monotonics"
version = "1.2.1"
version = "2.0.0"
features = ["imxrt_gpt1"]
[dependencies]

View file

@ -13,9 +13,8 @@ use bsp::logging;
use embedded_hal::serial::Write;
use rtic_monotonics::imxrt::Gpt1 as Mono;
use rtic_monotonics::imxrt::*;
use rtic_monotonics::Monotonic;
use rtic_monotonics::imxrt::prelude::*;
imxrt_gpt1_monotonic!(Mono, board::PERCLK_FREQUENCY);
#[rtic::app(device = teensy4_bsp, dispatchers = [LPSPI1])]
mod app {
@ -61,8 +60,7 @@ mod app {
// Initialize Monotonic
gpt1.set_clock_source(hal::gpt::ClockSource::PeripheralClock);
let gpt1_mono_token = rtic_monotonics::create_imxrt_gpt1_token!();
Mono::start(board::PERCLK_FREQUENCY, gpt1.release(), gpt1_mono_token);
Mono::start(gpt1.release());
// Setup LED
let led = board::led(&mut gpio2, pins.p13);

View file

@ -10,8 +10,8 @@ fn panic(_: &::core::panic::PanicInfo) -> ! {
use teensy4_bsp::{board, hal};
use rtic_monotonics::imxrt::Gpt1 as Mono;
use rtic_monotonics::imxrt::*;
use rtic_monotonics::imxrt::prelude::*;
imxrt_gpt1_monotonic!(Mono, board::PERCLK_FREQUENCY);
#[rtic::app(device = teensy4_bsp, dispatchers = [LPSPI1])]
mod app {
@ -36,8 +36,7 @@ mod app {
// Initialize Monotonic
gpt1.set_clock_source(hal::gpt::ClockSource::PeripheralClock);
let gpt1_mono_token = rtic_monotonics::create_imxrt_gpt1_token!();
Mono::start(board::PERCLK_FREQUENCY, gpt1.release(), gpt1_mono_token);
Mono::start(gpt1.release());
// Setup LED
let led = board::led(&mut gpio2, pins.p13);