diff options
author | 2016-10-03 01:46:20 -0500 | |
---|---|---|
committer | 2016-10-03 01:49:02 -0500 | |
commit | 3dc36eadb53a32f3fc713f744678eb08a2c50231 (patch) | |
tree | 4e7a3a2e96835edaa28c65780b03ff38bb9f1c34 /src | |
parent | 1961101569f8205394268be031ee4a7a50a5ef5d (diff) | |
download | cortex-m-3dc36eadb53a32f3fc713f744678eb08a2c50231.tar.gz cortex-m-3dc36eadb53a32f3fc713f744678eb08a2c50231.tar.zst cortex-m-3dc36eadb53a32f3fc713f744678eb08a2c50231.zip |
make this crate compile further for HOST
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 () { |