From e11f6995bc0b2b67e7f8937f831118a7e578c145 Mon Sep 17 00:00:00 2001
From: Per <Per Lindgren>
Date: Mon, 22 Jan 2018 11:34:08 +0100
Subject: [PATCH] for forked cortex-m

---
 Cargo.toml |  2 +-
 src/lib.rs | 26 ++++++++++++++++----------
 2 files changed, 17 insertions(+), 11 deletions(-)

diff --git a/Cargo.toml b/Cargo.toml
index d1af23f..d0d582a 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "cortex-m-debug"
-version = "0.1.0"
+version = "0.1.1"
 authors = ["Per Lindgren <per.lindgren@ltu.se>"]
 
 [dependencies]
diff --git a/src/lib.rs b/src/lib.rs
index 73ebcb5..1021385 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -4,18 +4,24 @@
 #[macro_export]
 macro_rules! ip {
     ($s:expr) => {
-        #[allow(unsafe_code)]
-        cortex_m::itm::write_str(
-            unsafe { &(&*cortex_m::peripheral::ITM.get()).stim[0] },
-            $s
-        );
+		{
+	    	extern crate cortex_m;
+	        #[allow(unsafe_code)]
+	        cortex_m::itm::write_str(
+	            unsafe { &(&*cortex_m::peripheral::ITM.get()).stim[0] },
+	            $s
+	        );
+	    }
     };
     ($($arg:tt)*) => {
-        #[allow(unsafe_code)]
-        cortex_m::itm::write_fmt(
-            unsafe { &(&*cortex_m::peripheral::ITM.get()).stim[0] },
-            format_args!($($arg)*
-        ));
+		{
+			extern crate cortex_m;
+	        #[allow(unsafe_code)]
+	        cortex_m::itm::write_fmt(
+	            unsafe { &(&*cortex_m::peripheral::ITM.get()).stim[0] },
+	            format_args!($($arg)*)
+	        );
+		}
     }
 }
 
-- 
GitLab