Browse Source

Remove semihosting

Kevin Lee 2 years ago
parent
commit
221019b322
1 changed files with 1 additions and 17 deletions
  1. 1 17
      Nixie_Firmware_Rust/src/main.rs

+ 1 - 17
Nixie_Firmware_Rust/src/main.rs

@@ -12,7 +12,6 @@ use core::panic::PanicInfo;
 use core::{cell::RefCell, ops::DerefMut};
 use cortex_m::{interrupt::free, interrupt::Mutex, peripheral::NVIC};
 use cortex_m_rt::entry;
-// use cortex_m_semihosting::hprintln;
 use stm32l4xx_hal::{
     delay::Delay,
     device::{I2C1, TIM2},
@@ -71,10 +70,6 @@ static REFRESH_TIMER: Mutex<RefCell<Option<Timer<TIM2>>>> = Mutex::new(RefCell::
 #[cfg(not(test))]
 #[entry]
 fn main() -> ! {
-    // Semihosting only works if debugger is connected.
-    // See https://github.com/rust-embedded/cortex-m/issues/289
-    // hprintln!("Hello, world!").unwrap();
-
     // Acquire a singleton instance for the chip's peripherals
     let mut dp = pac::Peripherals::take().unwrap();
     let cp = pac::CorePeripherals::take().unwrap();
@@ -278,8 +273,7 @@ fn EXTI3() {
         let mut nfault_ref = FAULT_INT.borrow(cs).borrow_mut();
         if let Some(ref mut nfault) = nfault_ref.deref_mut() {
             if nfault.check_interrupt() {
-                // hprintln!("Fault pin interrupt triggered!").unwrap();
-                // nfault.clear_interrupt_pending_bit();
+                nfault.clear_interrupt_pending_bit();
                 panic!();
             }
         }
@@ -300,16 +294,6 @@ fn TIM2() {
 #[cfg(not(test))]
 /// Custom panic handler
 fn panic(_info: &PanicInfo) -> ! {
-    // if let Some(location) = info.location() {
-    //     hprintln!(
-    //         "Panic in file '{}' at line {}",
-    //         location.file(),
-    //         location.line()
-    //     )
-    //     .unwrap();
-    // } else {
-    //     hprintln!("Panic'd!").unwrap();
-    // }
     set_fault_led(State::High);
     loop {
         continue;