mirror of
https://github.com/rtic-rs/rtic.git
synced 2024-12-03 16:57:14 +01:00
Merge #283
283: Include DWT enable in migration guide r=korken89 a=MabezDev Makes note of the fact the DWT has to be enabled manually in rtfm 0.5.0; an easy one to miss considering debuggers generally enable the DWT automatically. Co-authored-by: Scott Mabin <scott@mabez.dev>
This commit is contained in:
commit
ffe4c07869
1 changed files with 9 additions and 1 deletions
|
@ -192,7 +192,9 @@ the `monotonic = rtfm::cyccnt::CYCCNT` argument to the `#[rtfm::app]` attribute.
|
||||||
|
|
||||||
Also, the `Duration` and `Instant` types and the `U32Ext` trait have been moved
|
Also, the `Duration` and `Instant` types and the `U32Ext` trait have been moved
|
||||||
into the `rtfm::cyccnt` module. This module is only available on ARMv7-M+
|
into the `rtfm::cyccnt` module. This module is only available on ARMv7-M+
|
||||||
devices.
|
devices. The removal of the `timer-queue` also brings back the `DWT` peripheral
|
||||||
|
inside the core peripherals struct, this will need to be enabled by the application
|
||||||
|
inside `init`.
|
||||||
|
|
||||||
Change this:
|
Change this:
|
||||||
|
|
||||||
|
@ -217,6 +219,12 @@ use rtfm::cyccnt::{Duration, Instant, U32Ext};
|
||||||
#[rtfm::app(/* .. */, monotonic = rtfm::cyccnt::CYCCNT)]
|
#[rtfm::app(/* .. */, monotonic = rtfm::cyccnt::CYCCNT)]
|
||||||
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
const APP: () = {
|
const APP: () = {
|
||||||
|
#[init]
|
||||||
|
fn init(cx: init::Context) {
|
||||||
|
cx.core.DWT.enable_cycle_counter();
|
||||||
|
// optional, configure the DWT run without a debugger connected
|
||||||
|
cx.core.DCB.enable_trace();
|
||||||
|
}
|
||||||
#[task(schedule = [b])]
|
#[task(schedule = [b])]
|
||||||
fn a(cx: a::Context) {
|
fn a(cx: a::Context) {
|
||||||
// ..
|
// ..
|
||||||
|
|
Loading…
Reference in a new issue