From 5db28da7fbd761ea212cdbff1a9dcf6c4238c9c6 Mon Sep 17 00:00:00 2001 From: Levi Pearson Date: Fri, 10 Jul 2020 01:13:20 -0600 Subject: [PATCH] Switch to panic-rtt-target --- Cargo.toml | 9 +++++---- src/main.rs | 10 +--------- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 31550fa..35fcfc3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,18 +11,19 @@ cortex-m = "0.6.2" cortex-m-rt = "0.6.12" #cortex-m-semihosting = "0.3.5" # alternate panic impls, choose only one! -panic-halt = "0.2.0" +#panic-halt = "0.2.0" #panic-semihosting = "0.5.3" # requires cortex-m-semihosting #panic-itm = "0.4.1" #panic-abort = "0.3.2" #panic-ramdump = "0.1.1" #panic-persist = "0.2.1" -embedded-hal = "0.2.3" -nb = "0.1.2" +panic-rtt-target = { version = "0.1.0", features = ["cortex-m"] } +embedded-hal = "0.2.4" +nb = "1.0.0" rtt-target = { version = "0.2.0", features = ["cortex-m"] } [dependencies.stm32f1xx-hal] -version = "0.6.0" +version = "0.6.1" features = ["rt", "stm32f103", "medium"] [[bin]] diff --git a/src/main.rs b/src/main.rs index 156ddca..fd55b1a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -9,9 +9,8 @@ #![no_std] #![cfg_attr(not(doc), no_main)] -//use panic_halt as _; -use core::panic::PanicInfo; use rtt_target::{rprintln, rtt_init_print}; +use panic_rtt_target as _; use nb::block; @@ -65,10 +64,3 @@ fn main() -> ! { } } } - -#[inline(never)] -#[panic_handler] -fn panic(info: &PanicInfo) -> ! { - rprintln!("{}", info); - loop {} // You might need a compiler fence in here. -}