From 70cacc499c0a5cc3a56841591b4955ec45b18010 Mon Sep 17 00:00:00 2001 From: Hideki Sekine Date: Fri, 21 Sep 2018 02:42:41 +0900 Subject: remove unneeded code and dependencies. --- cortex-m-rt/examples/qemu.rs | 30 ++---------------------------- 1 file changed, 2 insertions(+), 28 deletions(-) (limited to 'cortex-m-rt/examples/qemu.rs') diff --git a/cortex-m-rt/examples/qemu.rs b/cortex-m-rt/examples/qemu.rs index 0bae8e7..e2cd895 100644 --- a/cortex-m-rt/examples/qemu.rs +++ b/cortex-m-rt/examples/qemu.rs @@ -6,12 +6,11 @@ extern crate cortex_m; extern crate cortex_m_rt as rt; extern crate cortex_m_semihosting as semihosting; -extern crate panic_semihosting; -extern crate unreachable; +extern crate panic_halt; use core::fmt::Write; use cortex_m::asm; -use rt::{entry, exception, ExceptionFrame}; +use rt::entry; #[entry] fn main() -> ! { @@ -24,32 +23,7 @@ fn main() -> ! { let mut hstdout = semihosting::hio::hstdout().unwrap(); write!(hstdout, "x = {}\n", x); - asm::nop(); - // exit from qemu semihosting::debug::exit(semihosting::debug::EXIT_SUCCESS); - - // hint to the optimizer that any code path which calls this function is statically unreachable - unsafe { - unreachable::unreachable(); - } } } - -#[exception] -#[inline(always)] -fn HardFault(_ef: &ExceptionFrame) -> ! { - loop { - asm::nop() - } -} - -#[exception] -#[inline(always)] -fn DefaultHandler(_irqn: i16) {} - -// use core::panic::PanicInfo; -// #[panic_handler] -// fn panic(_info: &PanicInfo) -> ! {{ -// semihosting::debug::exit(semihosting::debug::EXIT_SUCCESS)} -// } -- cgit v1.2.3