File tree Expand file tree Collapse file tree 5 files changed +10
-10
lines changed Expand file tree Collapse file tree 5 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -7,9 +7,14 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
7
7
8
8
## [ Unreleased]
9
9
10
+ ### Changed
11
+ - Bumped ` bare-metal ` to version ` 1.0.0 ` .
12
+
10
13
### Removed
11
14
- ` enable_cs ` removed due to soundness hole when interacting with ` Clone ` and
12
15
` interrupt::free ` .
16
+ - Remove ` peripherals ` module since the peripheral API is no longer provided by
17
+ ` bare-metal ` .
13
18
14
19
## [ v0.2.2] - 2020-04-23
15
20
Original file line number Diff line number Diff line change @@ -10,5 +10,4 @@ repository = "https://github.com/rust-embedded/msp430"
10
10
version = " 0.3.0"
11
11
12
12
[dependencies .bare-metal ]
13
- features = [" const-fn" ]
14
- version = " 0.2.0"
13
+ version = " 1.0.0"
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ pub fn disable() {
23
23
///
24
24
/// # Safety
25
25
///
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
27
27
/// call to `enable`. If `f()` owns `CriticalSection` tokens, it is recommended to [`drop`](https://doc.rust-lang.org/nightly/core/mem/fn.drop.html)
28
28
/// these tokens before calling `enable`.
29
29
#[ inline( always) ]
@@ -47,14 +47,15 @@ pub unsafe fn enable() {
47
47
/// This as also known as a "critical section".
48
48
pub fn free < F , R > ( f : F ) -> R
49
49
where
50
- F : FnOnce ( & CriticalSection ) -> R ,
50
+ F : for < ' a > FnOnce ( & ' a CriticalSection < ' a > ) -> R ,
51
51
{
52
52
let status = :: register:: sr:: read ( ) ;
53
53
54
54
// disable interrupts
55
55
disable ( ) ;
56
56
57
- let r = f ( unsafe { & CriticalSection :: new ( ) } ) ;
57
+ let cs = unsafe { CriticalSection :: new ( ) } ;
58
+ let r = f ( & cs) ;
58
59
59
60
// If the interrupts were active before our `disable` call, then re-enable
60
61
// them. Otherwise, keep them disabled
Original file line number Diff line number Diff line change @@ -18,5 +18,4 @@ extern crate bare_metal;
18
18
#[ macro_use]
19
19
pub mod asm;
20
20
pub mod interrupt;
21
- pub mod peripheral;
22
21
pub mod register;
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments