diff --git a/examples/serial.rs b/examples/serial.rs index 72756ff..7bfaf3d 100644 --- a/examples/serial.rs +++ b/examples/serial.rs @@ -8,13 +8,13 @@ #![no_main] #![no_std] -extern crate panic_semihosting; - use cortex_m_rt::entry; //use cortex_m_semihosting::hprintln; use hal::block; use hal::prelude::*; use hal::serial::{config::Config as SerialConfig, Serial}; +#[cfg(not(test))] +use panic_semihosting as _; #[entry] fn main() -> ! { diff --git a/examples/spi.rs b/examples/spi.rs index 6ad7ebf..d1677f9 100644 --- a/examples/spi.rs +++ b/examples/spi.rs @@ -8,13 +8,13 @@ #![no_main] #![no_std] -extern crate panic_semihosting; - use cortex_m_rt::entry; use cortex_m_semihosting::hprintln; //use hal::block; use hal::prelude::*; use hal::spi::{Mode, Phase, Polarity, Spi}; +#[cfg(not(test))] +use panic_semihosting as _; #[entry] fn main() -> ! { diff --git a/src/main.rs b/src/main.rs index 4d6e26e..c040415 100644 --- a/src/main.rs +++ b/src/main.rs @@ -22,6 +22,7 @@ use hal::{ stm32::{EXTI, SPI1, USART2}, }; use heapless::{consts::U8, Vec}; +#[cfg(not(test))] use panic_semihosting as _; use rtfm::app;