Skip to content
Snippets Groups Projects
Commit 5a19c39e authored by Jorge Aparicio's avatar Jorge Aparicio
Browse files

address review comments

parent 80328e98
Branches
Tags
No related merge requests found
......@@ -7,10 +7,14 @@
//! them at any given point in time) and the only way to get an instance of them is through the
//! [`Peripherals::take`](struct.Peripherals.html#method.take) method.
//!
//! ``` ignore
//! ``` no_run
//! extern crate cortex_m;
//!
//! use cortex_m::peripheral::Peripherals;
//!
//! fn main() {
//! let peripherals = Peripherals::take();
//! peripherals.dwt.enable_cycle_counter();
//! let mut peripherals = Peripherals::take().unwrap();
//! peripherals.DWT.enable_cycle_counter();
//! }
//! ```
//!
......@@ -21,15 +25,19 @@
//! API is provided as static methods on the peripheral types. One example is the
//! [`DWT::cyccnt`](struct.DWT.html#method.cyccnt) method.
//!
//! ``` ignore
//! ``` no_run
//! extern crate cortex_m;
//!
//! use cortex_m::peripheral::{DWT, Peripherals};
//!
//! fn main() {
//! {
//! let peripherals = Peripherals::take().unwrap();
//! let mut peripherals = Peripherals::take().unwrap();
//! peripherals.DWT.enable_cycle_counter();
//! } // all the peripheral singletons are destroyed here
//!
//! // but this method can be called without a DWT instance
//! let cyccnt = DWT::cyccnt();
//! let cyccnt = DWT::get_cycle_count();
//! }
//! ```
//!
......@@ -37,10 +45,14 @@
//! available on all the peripheral types. This method is a useful building block for implementing
//! higher level and safe abstractions.
//!
//! ``` ignore
//! ``` no_run
//! extern crate cortex_m;
//!
//! use cortex_m::peripheral::{DWT, Peripherals};
//!
//! fn main() {
//! {
//! let peripherals = Peripherals::take().unwrap();
//! let mut peripherals = Peripherals::take().unwrap();
//! peripherals.DWT.enable_cycle_counter();
//! } // all the peripheral singletons are destroyed here
//!
......
......@@ -87,8 +87,8 @@ impl NVIC {
/// Returns the NVIC priority of `interrupt`
///
/// *NOTE* NVIC encodes priority in the highest bits of a byte so values like `1` and `2` map
/// the same priority. Also for NVIC priorities, a lower value (e.g. `16`) has higher priority
/// (urgency) than a larger value (e.g. `32`).
/// to the same priority. Also for NVIC priorities, a lower value (e.g. `16`) has higher
/// priority (urgency) than a larger value (e.g. `32`).
pub fn get_priority<I>(interrupt: I) -> u8
where
I: Nr,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment