diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/asm.rs | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -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 () { |