File tree Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
11
11
12
12
### Changed
13
13
14
- - ` Mtvec::trap_mode() ` not returns ` Option<TrapMode> ` (breaking change)
14
+ - ` Mtvec::trap_mode() ` , ` Stvec::trap_mode() ` and ` Utvec::trap_mode() ` functions now return ` Option<TrapMode> ` (breaking change)
15
15
- Updated Minimum Supported Rust Version to 1.42.0
16
16
- Use ` llvm_asm! ` instead of ` asm! `
17
17
Original file line number Diff line number Diff line change @@ -20,12 +20,12 @@ impl Stvec {
20
20
}
21
21
22
22
/// Returns the trap-vector mode
23
- pub fn trap_mode ( & self ) -> TrapMode {
23
+ pub fn trap_mode ( & self ) -> Option < TrapMode > {
24
24
let mode = self . bits & 0b11 ;
25
25
match mode {
26
- 0 => TrapMode :: Direct ,
27
- 1 => TrapMode :: Vectored ,
28
- _ => unimplemented ! ( ) ,
26
+ 0 => Some ( TrapMode :: Direct ) ,
27
+ 1 => Some ( TrapMode :: Vectored ) ,
28
+ _ => None ,
29
29
}
30
30
}
31
31
}
Original file line number Diff line number Diff line change @@ -20,12 +20,12 @@ impl Utvec {
20
20
}
21
21
22
22
/// Returns the trap-vector mode
23
- pub fn trap_mode ( & self ) -> TrapMode {
23
+ pub fn trap_mode ( & self ) -> Option < TrapMode > {
24
24
let mode = self . bits & 0b11 ;
25
25
match mode {
26
- 0 => TrapMode :: Direct ,
27
- 1 => TrapMode :: Vectored ,
28
- _ => unimplemented ! ( ) ,
26
+ 0 => Some ( TrapMode :: Direct ) ,
27
+ 1 => Some ( TrapMode :: Vectored ) ,
28
+ _ => None ,
29
29
}
30
30
}
31
31
}
You can’t perform that action at this time.
0 commit comments