From 825b2c2c3a565920a31a87328caa82442a44d209 Mon Sep 17 00:00:00 2001 From: datdenkikniet Date: Sat, 22 Apr 2023 18:34:30 +0200 Subject: Update tips on Monotonic implemenations --- book/en/src/by-example/tips_monotonic_impl.md | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'book/en/src/by-example/tips_monotonic_impl.md') diff --git a/book/en/src/by-example/tips_monotonic_impl.md b/book/en/src/by-example/tips_monotonic_impl.md index 57b0a01..85b5709 100644 --- a/book/en/src/by-example/tips_monotonic_impl.md +++ b/book/en/src/by-example/tips_monotonic_impl.md @@ -1,14 +1,23 @@ # Implementing a `Monotonic` timer for scheduling -The framework is flexible because it can use any timer which has compare-match and optionally supporting overflow interrupts for scheduling. The single requirement to make a timer usable with RTIC is implementing the [`rtic-time::Monotonic`] trait. +The framework is flexible because it can use any timer which has compare-match and optionally supporting overflow interrupts for scheduling. The single requirement to make a timer usable with RTIC is implementing the `rtic-time::Monotonic` trait. -For RTIC 1.0 and 2.0 we instead assume the user has a time library, e.g. [`fugit`] or [`embedded_time`], as the basis for all time-based operations when implementing `Monotonic`. These libraries make it much easier to correctly implement the `Monotonic` trait, allowing the use of -almost any timer in the system for scheduling. +For RTIC 1.0 and 2.0 we instead assume the user has a time library, e.g. [`fugit`] or [`embedded_time`], as the basis for all time-based operations when implementing `Monotonic`. These libraries make it much easier to correctly implement the `Monotonic` trait, allowing the use of almost any timer in the system for scheduling. -The trait documents the requirements for each method, and for inspiration -there is a reference implementation based on the `SysTick` timer available on all ARM Cortex M MCUs. +The trait documents the requirements for each method. There are reference implementations available in [`rtic-monotonics`](https://github.com/rtic-rs/rtic/tree/master/rtic-monotonics/src) that can be used for inspriation. - [`Systick based`], runs at a fixed interrupt (tick) rate - with some overhead but simple and provides support for large time spans +- [`RP2040 Timer`], a "proper" implementation with support for waiting for long periods without interrupts. Clearly demonstrates how to use the `TimerQueue` to handle scheduling. +- [`nRF52 timers`] implements monotonic & Timer Queue for the RTC and normal timers in nRF52's + +## Contributing + +Contributing new implementations of `Monotonic` can be done in multiple ways: +* Implement the trait behind a feature flag in [`rtic-monotonics`], and create a PR for them to be included in the main RTIC repository. This way, the implementations of are in-tree, and RTIC can guarantee their correctness, and can update them in the case of a new release. +* Implement the changes in an external repository. + + +# V1.0.x Here is a list of `Monotonic` implementations for RTIC 1.0: @@ -27,3 +36,6 @@ If you know of more implementations feel free to add them to this list. [`Nordic nRF52 series RTC`]: https://gist.github.com/korken89/fe94a475726414dd1bce031c76adc3dd [`Systick based`]: https://github.com/rtic-monotonics [`DWT and Systick based`]: https://github.com/rtic-rs/dwt-systick-monotonic +[`rtic-monotonics`]: https://github.com/rtic-rs/rtic/blob/master/rtic-monotonics +[`RP2040 Timer`]: https://github.com/rtic-rs/rtic/blob/master/rtic-monotonics/src/rp2040.rs +[`nRF52 timers`]: https://github.com/rtic-rs/rtic/blob/master/rtic-monotonics/src/nrf.rs \ No newline at end of file -- cgit v1.2.3 From 4437f12b30e011a229c49d62538284d7ae61324e Mon Sep 17 00:00:00 2001 From: datdenkikniet Date: Sat, 22 Apr 2023 19:18:43 +0200 Subject: Remove link to inactive `embedded_time` --- book/en/src/by-example/tips_monotonic_impl.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'book/en/src/by-example/tips_monotonic_impl.md') diff --git a/book/en/src/by-example/tips_monotonic_impl.md b/book/en/src/by-example/tips_monotonic_impl.md index 85b5709..5dc4dd7 100644 --- a/book/en/src/by-example/tips_monotonic_impl.md +++ b/book/en/src/by-example/tips_monotonic_impl.md @@ -2,7 +2,7 @@ The framework is flexible because it can use any timer which has compare-match and optionally supporting overflow interrupts for scheduling. The single requirement to make a timer usable with RTIC is implementing the `rtic-time::Monotonic` trait. -For RTIC 1.0 and 2.0 we instead assume the user has a time library, e.g. [`fugit`] or [`embedded_time`], as the basis for all time-based operations when implementing `Monotonic`. These libraries make it much easier to correctly implement the `Monotonic` trait, allowing the use of almost any timer in the system for scheduling. +For RTIC 1.0 and 2.0 we instead assume the user has a time library, e.g. [`fugit`], as the basis for all time-based operations when implementing `Monotonic`. These libraries make it much easier to correctly implement the `Monotonic` trait, allowing the use of almost any timer in the system for scheduling. The trait documents the requirements for each method. There are reference implementations available in [`rtic-monotonics`](https://github.com/rtic-rs/rtic/tree/master/rtic-monotonics/src) that can be used for inspriation. @@ -30,7 +30,6 @@ If you know of more implementations feel free to add them to this list. [`rtic_time::Monotonic`]: https://docs.rs/rtic_time/ [`fugit`]: https://docs.rs/fugit/ -[`embedded_time`]: https://docs.rs/embedded_time/ [`STM32F411 series`]: https://github.com/kalkyl/f411-rtic/blob/a696fce7d6d19fda2356c37642c4d53547982cca/src/mono.rs [`Nordic nRF52 series Timer`]: https://github.com/kalkyl/nrf-play/blob/47f4410d4e39374c18ff58dc17c25159085fb526/src/mono.rs [`Nordic nRF52 series RTC`]: https://gist.github.com/korken89/fe94a475726414dd1bce031c76adc3dd -- cgit v1.2.3 From cb0ceea472f33ed7a8b17fe7e0b98f24927d9185 Mon Sep 17 00:00:00 2001 From: datdenkikniet Date: Sun, 23 Apr 2023 13:17:39 +0200 Subject: Remove v1 reference here --- book/en/src/by-example/tips_monotonic_impl.md | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) (limited to 'book/en/src/by-example/tips_monotonic_impl.md') diff --git a/book/en/src/by-example/tips_monotonic_impl.md b/book/en/src/by-example/tips_monotonic_impl.md index 5dc4dd7..9f88c19 100644 --- a/book/en/src/by-example/tips_monotonic_impl.md +++ b/book/en/src/by-example/tips_monotonic_impl.md @@ -4,7 +4,7 @@ The framework is flexible because it can use any timer which has compare-match a For RTIC 1.0 and 2.0 we instead assume the user has a time library, e.g. [`fugit`], as the basis for all time-based operations when implementing `Monotonic`. These libraries make it much easier to correctly implement the `Monotonic` trait, allowing the use of almost any timer in the system for scheduling. -The trait documents the requirements for each method. There are reference implementations available in [`rtic-monotonics`](https://github.com/rtic-rs/rtic/tree/master/rtic-monotonics/src) that can be used for inspriation. +The trait documents the requirements for each method. There are reference implementations available in [`rtic-monotonics`] that can be used for inspriation. - [`Systick based`], runs at a fixed interrupt (tick) rate - with some overhead but simple and provides support for large time spans - [`RP2040 Timer`], a "proper" implementation with support for waiting for long periods without interrupts. Clearly demonstrates how to use the `TimerQueue` to handle scheduling. @@ -16,25 +16,10 @@ Contributing new implementations of `Monotonic` can be done in multiple ways: * Implement the trait behind a feature flag in [`rtic-monotonics`], and create a PR for them to be included in the main RTIC repository. This way, the implementations of are in-tree, and RTIC can guarantee their correctness, and can update them in the case of a new release. * Implement the changes in an external repository. - -# V1.0.x - -Here is a list of `Monotonic` implementations for RTIC 1.0: - -- [`STM32F411 series`], implemented for the 32-bit timers -- [`Nordic nRF52 series Timer`], implemented for the 32-bit timers -- [`Nordic nRF52 series RTC`], implemented for the RTCs -- [`DWT and Systick based`], a more efficient (tickless) implementation - requires both `SysTick` and `DWT`, supports both high resolution and large time spans - -If you know of more implementations feel free to add them to this list. - +[`rtic-monotonics`]: https://github.com/rtic-rs/rtic/tree/master/rtic-monotonics/ [`rtic_time::Monotonic`]: https://docs.rs/rtic_time/ [`fugit`]: https://docs.rs/fugit/ -[`STM32F411 series`]: https://github.com/kalkyl/f411-rtic/blob/a696fce7d6d19fda2356c37642c4d53547982cca/src/mono.rs -[`Nordic nRF52 series Timer`]: https://github.com/kalkyl/nrf-play/blob/47f4410d4e39374c18ff58dc17c25159085fb526/src/mono.rs -[`Nordic nRF52 series RTC`]: https://gist.github.com/korken89/fe94a475726414dd1bce031c76adc3dd [`Systick based`]: https://github.com/rtic-monotonics -[`DWT and Systick based`]: https://github.com/rtic-rs/dwt-systick-monotonic [`rtic-monotonics`]: https://github.com/rtic-rs/rtic/blob/master/rtic-monotonics [`RP2040 Timer`]: https://github.com/rtic-rs/rtic/blob/master/rtic-monotonics/src/rp2040.rs [`nRF52 timers`]: https://github.com/rtic-rs/rtic/blob/master/rtic-monotonics/src/nrf.rs \ No newline at end of file -- cgit v1.2.3 From e51146a98cc7c83ea574d13b4b5d8e7ceeeb004b Mon Sep 17 00:00:00 2001 From: datdenkikniet Date: Sun, 23 Apr 2023 13:22:35 +0200 Subject: Move tips into their own subdir --- book/en/src/by-example/tips_monotonic_impl.md | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 book/en/src/by-example/tips_monotonic_impl.md (limited to 'book/en/src/by-example/tips_monotonic_impl.md') diff --git a/book/en/src/by-example/tips_monotonic_impl.md b/book/en/src/by-example/tips_monotonic_impl.md deleted file mode 100644 index 9f88c19..0000000 --- a/book/en/src/by-example/tips_monotonic_impl.md +++ /dev/null @@ -1,25 +0,0 @@ -# Implementing a `Monotonic` timer for scheduling - -The framework is flexible because it can use any timer which has compare-match and optionally supporting overflow interrupts for scheduling. The single requirement to make a timer usable with RTIC is implementing the `rtic-time::Monotonic` trait. - -For RTIC 1.0 and 2.0 we instead assume the user has a time library, e.g. [`fugit`], as the basis for all time-based operations when implementing `Monotonic`. These libraries make it much easier to correctly implement the `Monotonic` trait, allowing the use of almost any timer in the system for scheduling. - -The trait documents the requirements for each method. There are reference implementations available in [`rtic-monotonics`] that can be used for inspriation. - -- [`Systick based`], runs at a fixed interrupt (tick) rate - with some overhead but simple and provides support for large time spans -- [`RP2040 Timer`], a "proper" implementation with support for waiting for long periods without interrupts. Clearly demonstrates how to use the `TimerQueue` to handle scheduling. -- [`nRF52 timers`] implements monotonic & Timer Queue for the RTC and normal timers in nRF52's - -## Contributing - -Contributing new implementations of `Monotonic` can be done in multiple ways: -* Implement the trait behind a feature flag in [`rtic-monotonics`], and create a PR for them to be included in the main RTIC repository. This way, the implementations of are in-tree, and RTIC can guarantee their correctness, and can update them in the case of a new release. -* Implement the changes in an external repository. - -[`rtic-monotonics`]: https://github.com/rtic-rs/rtic/tree/master/rtic-monotonics/ -[`rtic_time::Monotonic`]: https://docs.rs/rtic_time/ -[`fugit`]: https://docs.rs/fugit/ -[`Systick based`]: https://github.com/rtic-monotonics -[`rtic-monotonics`]: https://github.com/rtic-rs/rtic/blob/master/rtic-monotonics -[`RP2040 Timer`]: https://github.com/rtic-rs/rtic/blob/master/rtic-monotonics/src/rp2040.rs -[`nRF52 timers`]: https://github.com/rtic-rs/rtic/blob/master/rtic-monotonics/src/nrf.rs \ No newline at end of file -- cgit v1.2.3