ld: Block pwr on request if alarm is asserted

- Align the alarm and pwr up behavior with thermostat temp_mon
This commit is contained in:
linuswck 2024-07-26 11:02:05 +08:00
parent 201148fb21
commit 3f9a4bf140
1 changed files with 8 additions and 6 deletions

View File

@ -211,6 +211,7 @@ impl LdPwrExcProtector {
pub fn pwr_on_and_arm_protection() { pub fn pwr_on_and_arm_protection() {
if let Some(ref mut wdg) = LdPwrExcProtector::get() { if let Some(ref mut wdg) = LdPwrExcProtector::get() {
if !wdg.alarm_status.pwr_excursion {
wdg.alarm_status = Status::default(); wdg.alarm_status = Status::default();
LdPwrExcProtector::clear_interrupt_bit(); LdPwrExcProtector::clear_interrupt_bit();
LdPwrExcProtector::pwr_on(); LdPwrExcProtector::pwr_on();
@ -219,6 +220,7 @@ impl LdPwrExcProtector {
LdPwrExcProtector::enable_watchdog_interrupt(); LdPwrExcProtector::enable_watchdog_interrupt();
} }
} }
}
pub fn clear_alarm_status() { pub fn clear_alarm_status() {
if let Some(ref mut wdg) = LdPwrExcProtector::get() { if let Some(ref mut wdg) = LdPwrExcProtector::get() {