aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar bors[bot] <26634292+bors[bot]@users.noreply.github.com> 2019-12-03 16:15:26 +0000
committerGravatar GitHub <noreply@github.com> 2019-12-03 16:15:26 +0000
commitffe4c0786985da1b8efd8c225f991e6afc6cddc2 (patch)
treee218726967c24e959a2f5409b9528070f1297c77
parent11d9bcdbd1983982c83df436ddacdd642b93f472 (diff)
parent864ec2ebc96907a07b4fbfdc43fa3a340ac9273f (diff)
downloadrtic-ffe4c0786985da1b8efd8c225f991e6afc6cddc2.tar.gz
rtic-ffe4c0786985da1b8efd8c225f991e6afc6cddc2.tar.zst
rtic-ffe4c0786985da1b8efd8c225f991e6afc6cddc2.zip
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>
-rw-r--r--book/en/src/migration.md10
1 files changed, 9 insertions, 1 deletions
diff --git a/book/en/src/migration.md b/book/en/src/migration.md
index a014c069..b1e8aefd 100644
--- a/book/en/src/migration.md
+++ b/book/en/src/migration.md
@@ -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
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:
@@ -217,6 +219,12 @@ use rtfm::cyccnt::{Duration, Instant, U32Ext};
#[rtfm::app(/* .. */, monotonic = rtfm::cyccnt::CYCCNT)]
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
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])]
fn a(cx: a::Context) {
// ..