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 1212#![ no_main]
1313#![ macro_use]
1414
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-
2115#[ cfg( all( not( test) , feature = "panic-handler" ) ) ]
2216#[ panic_handler]
2317fn 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+
2421 unsafe {
25- #[ cfg( feature = "cortex-m " ) ]
22+ #[ cfg( target_arch = "arm " ) ]
2623 core:: arch:: asm!( "udf #0" ) ;
27- #[ cfg( feature = "risc-v " ) ]
24+ #[ cfg( target_arch = "riscv32 " ) ]
2825 core:: arch:: asm!( "UNIMP" ) ;
2926 core:: hint:: unreachable_unchecked ( ) ;
3027 }
You can’t perform that action at this time.
0 commit comments