Skip to content
Snippets Groups Projects
Commit 3ef41518 authored by Per Lindgren's avatar Per Lindgren
Browse files

take instead of get

parent e11f6995
Branches
No related tags found
No related merge requests found
[package]
name = "cortex-m-debug"
version = "0.1.1"
version = "0.1.2"
authors = ["Per Lindgren <per.lindgren@ltu.se>"]
[dependencies]
......
#![no_std]
/// Macro for sending a formatted string through an ITM channel 0,
/// Interleaved with other output to ITM channel 0
#[macro_export]
macro_rules! ip {
($s:expr) => {
{
extern crate cortex_m;
#[allow(unsafe_code)]
let p = cortex_m::Peripherals::take().unwrap();
let mut itm = p.ITM;
cortex_m::itm::write_str(
unsafe { &(&*cortex_m::peripheral::ITM.get()).stim[0] },
&mut itm.stim[0],
$s
);
}
......@@ -18,7 +20,7 @@ macro_rules! ip {
extern crate cortex_m;
#[allow(unsafe_code)]
cortex_m::itm::write_fmt(
unsafe { &(&*cortex_m::peripheral::ITM.get()).stim[0] },
unsafe { &mut itm.stim[0] },
format_args!($($arg)*)
);
}
......@@ -40,7 +42,7 @@ macro_rules! ipln {
};
}
/// Macro for sending a formatted string overes semihosting, with a newline.
/// Macro for sending a formatted string over semihosting, with a newline.
#[macro_export]
macro_rules! sprintln {
($($e:tt)*) => {
......@@ -52,7 +54,7 @@ macro_rules! sprintln {
}
}
/// Macro for sending a formatted string overes semihosting.
/// Macro for sending a formatted string over semihosting.
#[macro_export]
macro_rules! sprint {
($($e:tt)*) => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment