diff options
author | 2019-01-24 19:43:16 +0100 | |
---|---|---|
committer | 2019-01-24 19:43:16 +0100 | |
commit | 77d205c3209aa5e4ed8821374e43b6bd1657d547 (patch) | |
tree | dc6a151d2e9662c98abbbdc0841566e16221b1ba | |
parent | a40436357a4fc655c09bb42b0ce95c92515fe7f4 (diff) | |
download | cortex-m-77d205c3209aa5e4ed8821374e43b6bd1657d547.tar.gz cortex-m-77d205c3209aa5e4ed8821374e43b6bd1657d547.tar.zst cortex-m-77d205c3209aa5e4ed8821374e43b6bd1657d547.zip |
doc: Remove obsolete references to entry!
-rw-r--r-- | cortex-m-rt/examples/main.rs | 2 | ||||
-rw-r--r-- | cortex-m-rt/src/lib.rs | 27 |
2 files changed, 8 insertions, 21 deletions
diff --git a/cortex-m-rt/examples/main.rs b/cortex-m-rt/examples/main.rs index b8ab66e..58e3cb4 100644 --- a/cortex-m-rt/examples/main.rs +++ b/cortex-m-rt/examples/main.rs @@ -1,4 +1,4 @@ -//! Directly plug a `main` symbol instead of using `entry!` +//! Directly plug a `main` symbol instead of using `#[entry]` #![deny(warnings)] #![no_main] diff --git a/cortex-m-rt/src/lib.rs b/cortex-m-rt/src/lib.rs index 9f2a20a..1dd686f 100644 --- a/cortex-m-rt/src/lib.rs +++ b/cortex-m-rt/src/lib.rs @@ -194,11 +194,11 @@ //! One will always find the following (unmangled) symbols in `cortex-m-rt` applications: //! //! - `Reset`. This is the reset handler. The microcontroller will executed this function upon -//! booting. This function will call the user program entry point (cf. [`entry!`]) using the `main` +//! booting. This function will call the user program entry point (cf. [`#[entry]`]) using the `main` //! symbol so you may also find that symbol in your program; if you do, `main` will contain your //! application code. Some other times `main` gets inlined into `Reset` so you won't find it. //! -//! [`entry!`]: macro.entry.html +//! [`#[entry]`]: https://docs.rs/cortex-m-rt-macros/0.1.5/cortex_m_rt_macros/attr.entry.html //! //! - `DefaultHandler`. This is the default handler. If not overridden using `#[exception] fn //! DefaultHandler(..` this will be an infinite loop. @@ -245,26 +245,13 @@ //! //! ## Setting the program entry point //! -//! This section describes how `entry!` is implemented. This information is useful to developers who -//! want to provide an alternative to `entry!` that provides extra guarantees. +//! This section describes how `#[entry]` is implemented. This information is useful to developers who +//! want to provide an alternative to `#[entry]` that provides extra guarantees. //! //! The `Reset` handler will call a symbol named `main` (unmangled) *after* initializing `.bss` and -//! `.data`, and enabling the FPU (if the target is `thumbv7em-none-eabihf`). `entry!` provides this -//! symbol in its expansion: -//! -//! ``` ignore -//! entry!(path::to::main); -//! -//! // expands into -//! -//! #[export_name = "main"] -//! pub extern "C" fn __impl_main() -> ! { -//! // validate the signature of the program entry point -//! let f: fn() -> ! = path::to::main; -//! -//! f() -//! } -//! ``` +//! `.data`, and enabling the FPU (if the target is `thumbv7em-none-eabihf`). A function with the +//! `entry` attribute will be set to have the export name "`main`"; in addition, its mutable +//! statics are turned into safe mutable references (see [`#[entry]`] for details). //! //! The unmangled `main` symbol must have signature `extern "C" fn() -> !` or its invocation from //! `Reset` will result in undefined behavior. |