print panic messages on UART

This commit is contained in:
Sebastien Bourdeauducq 2017-08-06 19:52:11 +08:00
parent d18712d1be
commit f156c7c6d1
2 changed files with 9 additions and 2 deletions

View File

@ -5,7 +5,7 @@ authors = ["whitequark <whitequark@whitequark.org>"]
[dependencies]
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]
git = "https://github.com/m-labs/dslite2svd"

View File

@ -1,4 +1,4 @@
#![feature(used, const_fn, core_float, asm)]
#![feature(used, const_fn, core_float, asm, lang_items)]
#![no_std]
extern crate cortex_m;
@ -30,6 +30,13 @@ macro_rules! println {
($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]
mod board;
mod ethmac;