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

address review comments

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