print panic messages on UART
This commit is contained in:
parent
d18712d1be
commit
f156c7c6d1
|
@ -5,7 +5,7 @@ authors = ["whitequark <whitequark@whitequark.org>"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
cortex-m = "0.3.1"
|
cortex-m = "0.3.1"
|
||||||
cortex-m-rt = { version = "0.3.5", features = ["abort-on-panic"] }
|
cortex-m-rt = { version = "0.3.5" }
|
||||||
|
|
||||||
[dependencies.tm4c129x]
|
[dependencies.tm4c129x]
|
||||||
git = "https://github.com/m-labs/dslite2svd"
|
git = "https://github.com/m-labs/dslite2svd"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#![feature(used, const_fn, core_float, asm)]
|
#![feature(used, const_fn, core_float, asm, lang_items)]
|
||||||
#![no_std]
|
#![no_std]
|
||||||
|
|
||||||
extern crate cortex_m;
|
extern crate cortex_m;
|
||||||
|
@ -30,6 +30,13 @@ macro_rules! println {
|
||||||
($fmt:expr, $($arg:tt)*) => (print!(concat!($fmt, "\n"), $($arg)*));
|
($fmt:expr, $($arg:tt)*) => (print!(concat!($fmt, "\n"), $($arg)*));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[no_mangle]
|
||||||
|
#[lang = "panic_fmt"]
|
||||||
|
fn panic_fmt(args: core::fmt::Arguments, file: &'static str, line: u32) -> ! {
|
||||||
|
println!("panic at {}:{}: {}", file, line, args);
|
||||||
|
loop {}
|
||||||
|
}
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
mod board;
|
mod board;
|
||||||
mod ethmac;
|
mod ethmac;
|
||||||
|
|
Loading…
Reference in New Issue