diff --git a/src/laser_diode/ld_pwr_exc_protector.rs b/src/laser_diode/ld_pwr_exc_protector.rs index 114a734..01eaec3 100644 --- a/src/laser_diode/ld_pwr_exc_protector.rs +++ b/src/laser_diode/ld_pwr_exc_protector.rs @@ -211,12 +211,14 @@ impl LdPwrExcProtector { pub fn pwr_on_and_arm_protection() { if let Some(ref mut wdg) = LdPwrExcProtector::get() { - wdg.alarm_status = Status::default(); - LdPwrExcProtector::clear_interrupt_bit(); - LdPwrExcProtector::pwr_on(); - // Interrupt should be enabled after power on to tackle the following edge case: - // Pd_Mon pin voltage has already exceed threshold before LD Power is on. - LdPwrExcProtector::enable_watchdog_interrupt(); + if !wdg.alarm_status.pwr_excursion { + wdg.alarm_status = Status::default(); + LdPwrExcProtector::clear_interrupt_bit(); + LdPwrExcProtector::pwr_on(); + // Interrupt should be enabled after power on to tackle the following edge case: + // Pd_Mon pin voltage has already exceed threshold before LD Power is on. + LdPwrExcProtector::enable_watchdog_interrupt(); + } } }