Skip to content

Commit e0abee8

Browse files
committed
Auto merge of #77 - japaric:v4, r=japaric
v0.4.0 None
2 parents d52b84c + 56f0804 commit e0abee8

File tree

3 files changed

+42
-6
lines changed

3 files changed

+42
-6
lines changed

CHANGELOG.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,32 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
77

88
## [Unreleased]
99

10+
## [v0.4.0] - 2018-01-15
11+
12+
### Added
13+
14+
- Formatter and Flush Control register (FFCR) accessor to the TPIU register block.
15+
16+
- A `singleton!` macro that creates mutable reference to a statically allocated variable.
17+
18+
- A Cargo feature, `cm7-r0p1`, to work around a silicon erratum that affects writes to BASEPRI on
19+
Cortex-M7 r0p1 devices.
20+
21+
### Changed
22+
23+
- [breaking-change] All peripherals are now exposed as scoped singletons and they need to be `take`n
24+
into scope to become accessible.
25+
26+
- [breaking-change] The signatures of methods exposed by peripheral proxies have changed to
27+
better match the new scoped singletons semantics.
28+
29+
- All the thin wrappers around assembly instructions now panic when executed on non-ARM devices.
30+
31+
### Removed
32+
33+
- [breaking-change] APIs specific to ARMv7-M (`peripheral::{cbp, fpb, fpu, itm, tpiu}`, `itm`) when
34+
compiling for `thumb6m-none-eabi`.
35+
1036
## [v0.3.1] - 2017-07-20
1137

1238
### Changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ keywords = ["arm", "cortex-m", "register", "peripheral"]
77
license = "MIT OR Apache-2.0"
88
name = "cortex-m"
99
repository = "https://github.com/japaric/cortex-m"
10-
version = "0.3.1"
10+
version = "0.4.0"
1111

1212
[dependencies]
1313
aligned = "0.1.1"

src/peripheral/mod.rs

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
//! # API
44
//!
55
//! To use (most of) the peripheral API first you must get an *instance* of the peripheral. All the
6-
//! core peripherals are modeled as singletons (there can only ever be, at most, one instance of
7-
//! them at any given point in time) and the only way to get an instance of them is through the
8-
//! [`Peripherals::take`](struct.Peripherals.html#method.take) method.
6+
//! core peripherals are modeled as singletons (there can only ever be, at most, one instance of any
7+
//! one of them at any given point in time) and the only way to get an instance of them is through
8+
//! the [`Peripherals::take`](struct.Peripherals.html#method.take) method.
99
//!
1010
//! ``` no_run
1111
//! extern crate cortex_m;
@@ -21,9 +21,19 @@
2121
//! This method can only be successfully called *once* -- this is why the method returns an
2222
//! `Option`. Subsequent calls to the method will result in a `None` value being returned.
2323
//!
24+
//! ``` no_run
25+
//! extern crate cortex_m;
26+
//!
27+
//! use cortex_m::peripheral::Peripherals;
28+
//!
29+
//! fn main() {
30+
//! let ok = Peripherals::take().unwrap();
31+
//! let panics = Peripherals::take().unwrap();
32+
//! }
33+
//! ```
2434
//! A part of the peripheral API doesn't require access to a peripheral instance. This part of the
2535
//! API is provided as static methods on the peripheral types. One example is the
26-
//! [`DWT::cyccnt`](struct.DWT.html#method.cyccnt) method.
36+
//! [`DWT::get_cycle_count`](struct.DWT.html#method.get_cycle_count) method.
2737
//!
2838
//! ``` no_run
2939
//! extern crate cortex_m;
@@ -43,7 +53,7 @@
4353
//!
4454
//! The singleton property can be *unsafely* bypassed using the `ptr` static method which is
4555
//! available on all the peripheral types. This method is a useful building block for implementing
46-
//! higher level and safe abstractions.
56+
//! safe higher level abstractions.
4757
//!
4858
//! ``` no_run
4959
//! extern crate cortex_m;

0 commit comments

Comments
 (0)