File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -15,3 +15,5 @@ default = ["erase-chip", "panic-handler"]
15
15
erase-chip = []
16
16
panic-handler = []
17
17
verify = []
18
+ cortex-m = []
19
+ risc-v = []
Original file line number Diff line number Diff line change 12
12
#![ no_main]
13
13
#![ macro_use]
14
14
15
+ #[ cfg( not( any( feature = "cortex-m" , feature = "risc-v" , feature = "panic-handler" ) ) ) ]
16
+ compile_error ! ( "Enable either the cortex-m or risc-v feature" ) ;
17
+
15
18
#[ cfg( all( not( test) , feature = "panic-handler" ) ) ]
16
19
#[ panic_handler]
17
20
fn panic ( _info : & core:: panic:: PanicInfo ) -> ! {
18
21
unsafe {
22
+ #[ cfg( feature = "cortex-m" ) ]
19
23
core:: arch:: asm!( "udf #0" ) ;
24
+ #[ cfg( feature = "risc-v" ) ]
25
+ core:: arch:: asm!( "UNIMP" ) ;
20
26
core:: hint:: unreachable_unchecked ( ) ;
21
27
}
22
28
}
You can’t perform that action at this time.
0 commit comments