Skip to content

Commit fd53654

Browse files
authored
Merge pull request #9 from YuhanLiin/bump-bare-metal
Bump bare metal to 1.0.0
2 parents 9d0503e + 7362305 commit fd53654

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

CHANGELOG.md

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

88
## [Unreleased]
99

10+
### Changed
11+
- Bumped `bare-metal` to version `1.0.0`.
12+
1013
### Removed
1114
- `enable_cs` removed due to soundness hole when interacting with `Clone` and
1215
`interrupt::free`.
16+
- Remove `peripherals` module since the peripheral API is no longer provided by
17+
`bare-metal`.
1318

1419
## [v0.2.2] - 2020-04-23
1520

Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,4 @@ repository = "https://github.com/rust-embedded/msp430"
1010
version = "0.3.0"
1111

1212
[dependencies.bare-metal]
13-
features = ["const-fn"]
14-
version = "0.2.0"
13+
version = "1.0.0"

src/interrupt.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ pub fn disable() {
2323
///
2424
/// # Safety
2525
///
26-
/// - In any function `f()` that calls `enable`, `CriticalSection` or `&CriticalSection` tokens cannot be used in `f()`'s body after the
26+
/// - In any function `f()` that calls `enable`, `CriticalSection` or `&CriticalSection` tokens cannot be used in `f()`'s body after the
2727
/// call to `enable`. If `f()` owns `CriticalSection` tokens, it is recommended to [`drop`](https://doc.rust-lang.org/nightly/core/mem/fn.drop.html)
2828
/// these tokens before calling `enable`.
2929
#[inline(always)]
@@ -47,14 +47,15 @@ pub unsafe fn enable() {
4747
/// This as also known as a "critical section".
4848
pub fn free<F, R>(f: F) -> R
4949
where
50-
F: FnOnce(&CriticalSection) -> R,
50+
F: for<'a> FnOnce(&'a CriticalSection<'a>) -> R,
5151
{
5252
let status = ::register::sr::read();
5353

5454
// disable interrupts
5555
disable();
5656

57-
let r = f(unsafe { &CriticalSection::new() });
57+
let cs = unsafe { CriticalSection::new() };
58+
let r = f(&cs);
5859

5960
// If the interrupts were active before our `disable` call, then re-enable
6061
// them. Otherwise, keep them disabled

src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,4 @@ extern crate bare_metal;
1818
#[macro_use]
1919
pub mod asm;
2020
pub mod interrupt;
21-
pub mod peripheral;
2221
pub mod register;

src/peripheral/mod.rs

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)