We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4d6bee9 commit d140381Copy full SHA for d140381
src/lib.rs
@@ -12,19 +12,16 @@
12
#![no_main]
13
#![macro_use]
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
#[cfg(all(not(test), feature = "panic-handler"))]
22
#[panic_handler]
23
fn panic(_info: &core::panic::PanicInfo) -> ! {
+ #[cfg(not(any(target_arch = "arm", target_arch = "riscv32")))]
+ compile_error!("Panic handler can only be compiled for arm and riscv32");
+
24
unsafe {
25
- #[cfg(feature = "cortex-m")]
+ #[cfg(target_arch = "arm")]
26
core::arch::asm!("udf #0");
27
- #[cfg(feature = "risc-v")]
+ #[cfg(target_arch = "riscv32")]
28
core::arch::asm!("UNIMP");
29
core::hint::unreachable_unchecked();
30
}
0 commit comments