Skip to content

Commit 7dc0b54

Browse files
committed
Clean up the markdown formatting.
Now passes the new, stricter, clippy lints.
1 parent ab76798 commit 7dc0b54

File tree

1 file changed

+23
-22
lines changed

1 file changed

+23
-22
lines changed

cortex-m-rt/src/lib.rs

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
//! This crates takes care of:
99
//!
1010
//! - The memory layout of the program. In particular, it populates the vector table so the device
11-
//! can boot correctly, and properly dispatch exceptions and interrupts.
11+
//! can boot correctly, and properly dispatch exceptions and interrupts.
1212
//!
1313
//! - Initializing `static` variables before the program entry point.
1414
//!
@@ -188,8 +188,8 @@
188188
//! ## `paint-stack`
189189
//!
190190
//! Everywhere between `__sheap` and `___stack_start` is painted with the fixed value `STACK_PAINT_VALUE`.
191-
//! You can then inspect memory during debugging to determine how much of the stack has been used
192-
//! - where the stack has been used the 'paint' will have been 'scrubbed off' and the memory will
191+
//! You can then inspect memory during debugging to determine how much of the stack has been used -
192+
//! where the stack has been used the 'paint' will have been 'scrubbed off' and the memory will
193193
//! have a value other than `STACK_PAINT_VALUE`.
194194
//!
195195
//! # Inspection
@@ -228,42 +228,42 @@
228228
//! One will always find the following (unmangled) symbols in `cortex-m-rt` applications:
229229
//!
230230
//! - `Reset`. This is the reset handler. The microcontroller will execute this function upon
231-
//! booting. This function will call the user program entry point (cf. [`#[entry]`][attr-entry])
232-
//! using the `main` symbol so you will also find that symbol in your program.
231+
//! booting. This function will call the user program entry point (cf. [`#[entry]`][attr-entry])
232+
//! using the `main` symbol so you will also find that symbol in your program.
233233
//!
234234
//! - `DefaultHandler`. This is the default handler. If not overridden using `#[exception] fn
235-
//! DefaultHandler(..` this will be an infinite loop.
235+
//! DefaultHandler(..` this will be an infinite loop.
236236
//!
237237
//! - `HardFault` and `_HardFault`. These function handle the hard fault handling and what they
238-
//! do depends on whether the hard fault is overridden and whether the trampoline is enabled (which it is by default).
238+
//! do depends on whether the hard fault is overridden and whether the trampoline is enabled (which it is by default).
239239
//! - No override: Both are the same function. The function is an infinite loop defined in the cortex-m-rt crate.
240240
//! - Trampoline enabled: `HardFault` is the real hard fault handler defined in assembly. This function is simply a
241-
//! trampoline that jumps into the rust defined `_HardFault` function. This second function jumps to the user-defined
242-
//! handler with the exception frame as parameter. This second jump is usually optimised away with inlining.
241+
//! trampoline that jumps into the rust defined `_HardFault` function. This second function jumps to the user-defined
242+
//! handler with the exception frame as parameter. This second jump is usually optimised away with inlining.
243243
//! - Trampoline disabled: `HardFault` is the user defined function. This means the user function is called directly
244-
//! from the vector table. `_HardFault` still exists, but is an empty function that is purely there for compiler
245-
//! diagnostics.
244+
//! from the vector table. `_HardFault` still exists, but is an empty function that is purely there for compiler
245+
//! diagnostics.
246246
//!
247247
//! - `__STACK_START`. This is the first entry in the `.vector_table` section. This symbol contains
248-
//! the initial value of the stack pointer; this is where the stack will be located -- the stack
249-
//! grows downwards towards smaller addresses.
248+
//! the initial value of the stack pointer; this is where the stack will be located -- the stack
249+
//! grows downwards towards smaller addresses.
250250
//!
251251
//! - `__RESET_VECTOR`. This is the reset vector, a pointer to the `Reset` function. This vector
252-
//! is located in the `.vector_table` section after `__STACK_START`.
252+
//! is located in the `.vector_table` section after `__STACK_START`.
253253
//!
254254
//! - `__EXCEPTIONS`. This is the core exceptions portion of the vector table; it's an array of 14
255-
//! exception vectors, which includes exceptions like `HardFault` and `SysTick`. This array is
256-
//! located after `__RESET_VECTOR` in the `.vector_table` section.
255+
//! exception vectors, which includes exceptions like `HardFault` and `SysTick`. This array is
256+
//! located after `__RESET_VECTOR` in the `.vector_table` section.
257257
//!
258258
//! - `__INTERRUPTS`. This is the device specific interrupt portion of the vector table; its exact
259-
//! size depends on the target device but if the `"device"` feature has not been enabled it will
260-
//! have a size of 32 vectors (on ARMv6-M) or 240 vectors (on ARMv7-M). This array is located after
261-
//! `__EXCEPTIONS` in the `.vector_table` section.
259+
//! size depends on the target device but if the `"device"` feature has not been enabled it will
260+
//! have a size of 32 vectors (on ARMv6-M) or 240 vectors (on ARMv7-M). This array is located after
261+
//! `__EXCEPTIONS` in the `.vector_table` section.
262262
//!
263263
//! - `__pre_init`. This is a function to be run before RAM is initialized. It defaults to an empty
264-
//! function. As this runs before RAM is initialised, it is not sound to use a Rust function for
265-
//! `pre_init`, and instead it should typically be written in assembly using `global_asm` or an
266-
//! external assembly file.
264+
//! function. As this runs before RAM is initialised, it is not sound to use a Rust function for
265+
//! `pre_init`, and instead it should typically be written in assembly using `global_asm` or an
266+
//! external assembly file.
267267
//!
268268
//! If you override any exception handler you'll find it as an unmangled symbol, e.g. `SysTick` or
269269
//! `SVCall`, in the output of `objdump`,
@@ -899,6 +899,7 @@ pub static __ONCE__: () = ();
899899
/// Registers stacked (pushed onto the stack) during an exception.
900900
#[derive(Clone, Copy)]
901901
#[repr(C)]
902+
#[allow(dead_code)]
902903
pub struct ExceptionFrame {
903904
r0: u32,
904905
r1: u32,

0 commit comments

Comments
 (0)