From 401bc6bcb3423f59a231d4d5ef89db32d2b86b7b Mon Sep 17 00:00:00 2001 From: mwojcik Date: Mon, 10 Oct 2022 14:59:40 +0800 Subject: [PATCH] better documentation for error led enabling --- src/runtime/src/comms.rs | 3 ++- src/runtime/src/panic.rs | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/runtime/src/comms.rs b/src/runtime/src/comms.rs index b3ccb3a..d282560 100644 --- a/src/runtime/src/comms.rs +++ b/src/runtime/src/comms.rs @@ -538,7 +538,8 @@ pub fn soft_panic_main(timer: GlobalTimer, cfg: Config) -> ! { mgmt::start(cfg); - //getting eth settings disables the LED - need enable it here + // getting eth settings disables the LED as it resets GPIO + // need to re-enable it here #[cfg(feature = "target_kasli_soc")] { let mut err_led = ErrorLED::error_led(); diff --git a/src/runtime/src/panic.rs b/src/runtime/src/panic.rs index 967f0bb..c0566fc 100644 --- a/src/runtime/src/panic.rs +++ b/src/runtime/src/panic.rs @@ -37,14 +37,14 @@ fn panic(info: &core::panic::PanicInfo) -> ! { SOFT_PANICKED = true; PANICKED[id] = true; } - if !soft_panicked && id == 0 { - soft_panic(info); - } #[cfg(feature = "target_kasli_soc")] { let mut err_led = ErrorLED::error_led(); err_led.toggle(true); } + if !soft_panicked && id == 0 { + soft_panic(info); + } println!("Backtrace: "); let _ = backtrace(|ip| { // Backtrace gives us the return address, i.e. the address after the delay slot,