diff options
author | 2018-09-21 02:42:41 +0900 | |
---|---|---|
committer | 2018-09-21 02:42:41 +0900 | |
commit | 70cacc499c0a5cc3a56841591b4955ec45b18010 (patch) | |
tree | 7f9c8f17b62704711c38dcdce0332115c946481e /cortex-m-rt/examples/qemu.rs | |
parent | 25e2ed7da74f70e03e6c1c271fe608bc94c9a0e4 (diff) | |
download | cortex-m-70cacc499c0a5cc3a56841591b4955ec45b18010.tar.gz cortex-m-70cacc499c0a5cc3a56841591b4955ec45b18010.tar.zst cortex-m-70cacc499c0a5cc3a56841591b4955ec45b18010.zip |
remove unneeded code and dependencies.
Diffstat (limited to 'cortex-m-rt/examples/qemu.rs')
-rw-r--r-- | cortex-m-rt/examples/qemu.rs | 30 |
1 files changed, 2 insertions, 28 deletions
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)} -// } |