aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jorge Aparicio <japaricious@gmail.com> 2016-10-03 01:46:20 -0500
committerGravatar Jorge Aparicio <japaricious@gmail.com> 2016-10-03 01:49:02 -0500
commit3dc36eadb53a32f3fc713f744678eb08a2c50231 (patch)
tree4e7a3a2e96835edaa28c65780b03ff38bb9f1c34
parent1961101569f8205394268be031ee4a7a50a5ef5d (diff)
downloadcortex-m-3dc36eadb53a32f3fc713f744678eb08a2c50231.tar.gz
cortex-m-3dc36eadb53a32f3fc713f744678eb08a2c50231.tar.zst
cortex-m-3dc36eadb53a32f3fc713f744678eb08a2c50231.zip
make this crate compile further for HOST
-rw-r--r--CHANGELOG.md5
-rw-r--r--src/asm.rs16
2 files changed, 21 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0bb5286..a39c5bf 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
## [Unreleased]
+### Changed
+
+- Small, non user visible change to make this crate compile further for $HOST (e.g. x86_64) with the
+ goal of making it possible to test, on the HOST, downstream crates that depend on this one.
+
## [v0.1.0] - 2016-09-27
### Added
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 () {