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