diff options
author | 2018-09-21 02:42:41 +0900 | |
---|---|---|
committer | 2018-09-21 02:42:41 +0900 | |
commit | 70cacc499c0a5cc3a56841591b4955ec45b18010 (patch) | |
tree | 7f9c8f17b62704711c38dcdce0332115c946481e | |
parent | 25e2ed7da74f70e03e6c1c271fe608bc94c9a0e4 (diff) | |
download | cortex-m-70cacc499c0a5cc3a56841591b4955ec45b18010.tar.gz cortex-m-70cacc499c0a5cc3a56841591b4955ec45b18010.tar.zst cortex-m-70cacc499c0a5cc3a56841591b4955ec45b18010.zip |
remove unneeded code and dependencies.
-rw-r--r-- | cortex-m-rt/Cargo.toml | 2 | ||||
-rw-r--r-- | cortex-m-rt/examples/qemu.rs | 30 |
2 files changed, 2 insertions, 30 deletions
diff --git a/cortex-m-rt/Cargo.toml b/cortex-m-rt/Cargo.toml index 19e29e5..fdee9bb 100644 --- a/cortex-m-rt/Cargo.toml +++ b/cortex-m-rt/Cargo.toml @@ -17,9 +17,7 @@ cortex-m-rt-macros = { path = "macros", version = "0.1.1" } [dev-dependencies] cortex-m = "0.5.4" panic-halt = "0.2.0" -panic-semihosting = "0.5.0" cortex-m-semihosting = "0.3.1" -unreachable = "1.0.0" [dev-dependencies.rand] default-features = false 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)} -// } |