aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/asm.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/asm.rs b/src/asm.rs
index 3337626..1de0d32 100644
--- a/src/asm.rs
+++ b/src/asm.rs
@@ -4,6 +4,7 @@
///
/// Optionally, an "immediate" value (in the 0-255 range) can be passed to `bkpt!`. The debugger can
/// then read this value using the Program Counter (PC).
+#[cfg(target_arch = "arm")]
#[macro_export]
macro_rules! bkpt {
() => {
@@ -14,6 +15,21 @@ macro_rules! bkpt {
};
}
+/// Puts the processor in Debug state. Debuggers can pick this up as a "breakpoint".
+///
+/// Optionally, an "immediate" value (in the 0-255 range) can be passed to `bkpt!`. The debugger can
+/// then read this value using the Program Counter (PC).
+#[cfg(not(target_arch = "arm"))]
+#[macro_export]
+macro_rules! bkpt {
+ () => {
+ asm!("nop" :::: "volatile");
+ };
+ ($e:expr) => {
+ asm!("nop" :::: "volatile");
+ };
+}
+
/// Wait for event
pub unsafe fn wfe() {
match () {