From 9b6ef68eac5df5af3091eef43ada5558785c15d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20J=C3=B6rdens?= Date: Fri, 7 Jun 2019 14:28:22 +0000 Subject: [PATCH] fix panic handler --- src/main.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index 9b4c25b..56cfcd1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -8,9 +8,8 @@ #[panic_handler] #[cfg(not(feature = "semihosting"))] fn panic(_info: &core::panic::PanicInfo) -> ! { - let dp = unsafe { pac::Peripherals::steal() }; - dp.GPIOD.odr.modify(|_, w| w.odr6().high()); // FP_LED_1 - dp.GPIOG.odr.modify(|_, w| w.odr4().high()); // FP_LED_3 + let gpiod = unsafe { &*pac::GPIOD::ptr() }; + gpiod.odr.modify(|_, w| w.odr6().high().odr12().high()); // FP_LED_1, FP_LED_3 loop { core::sync::atomic::compiler_fence(core::sync::atomic::Ordering::SeqCst); } }