aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar bors[bot] <26634292+bors[bot]@users.noreply.github.com> 2021-09-23 22:46:08 +0000
committerGravatar GitHub <noreply@github.com> 2021-09-23 22:46:08 +0000
commit6b013138b734b9bbeb24a345f75d2bcc1c69fa8d (patch)
treef00cb788aed9a1521bc6bc5a3eeb4f5d6ee7fa67
parent9e9ab9a8486fa649d448420bb25f7ef1ca53fcb9 (diff)
parent9ddc44c595a611e3da51a90453c19ad83fdf2bfb (diff)
downloadcortex-m-6b013138b734b9bbeb24a345f75d2bcc1c69fa8d.tar.gz
cortex-m-6b013138b734b9bbeb24a345f75d2bcc1c69fa8d.tar.zst
cortex-m-6b013138b734b9bbeb24a345f75d2bcc1c69fa8d.zip
Merge #348
348: Fix slightly misleading examples. r=adamgreig a=newAM This is a bit of a nitpick; the examples provided for the peripherals use the cycle counter as an example, but it is not properly enabled, which is slightly misleading. The examples only do `peripherals.DWT.enable_cycle_counter`, but this write may be ignored because tracing needs to be enabled first. Co-authored-by: Alex Martens <alexmgit@protonmail.com>
-rw-r--r--src/peripheral/mod.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/peripheral/mod.rs b/src/peripheral/mod.rs
index 463a6ec..5c5e7ce 100644
--- a/src/peripheral/mod.rs
+++ b/src/peripheral/mod.rs
@@ -10,7 +10,7 @@
//! ``` no_run
//! # use cortex_m::peripheral::Peripherals;
//! let mut peripherals = Peripherals::take().unwrap();
-//! peripherals.DWT.enable_cycle_counter();
+//! peripherals.DCB.enable_trace();
//! ```
//!
//! This method can only be successfully called *once* -- this is why the method returns an
@@ -29,6 +29,7 @@
//! # use cortex_m::peripheral::{DWT, Peripherals};
//! {
//! let mut peripherals = Peripherals::take().unwrap();
+//! peripherals.DCB.enable_trace();
//! peripherals.DWT.enable_cycle_counter();
//! } // all the peripheral singletons are destroyed here
//!
@@ -44,6 +45,7 @@
//! # use cortex_m::peripheral::{DWT, Peripherals};
//! {
//! let mut peripherals = Peripherals::take().unwrap();
+//! peripherals.DCB.enable_trace();
//! peripherals.DWT.enable_cycle_counter();
//! } // all the peripheral singletons are destroyed here
//!