Sub: Fix AP_Notify leak flag logic

This commit is contained in:
Jacob Walser 2017-09-18 14:02:03 -04:00
parent 6536bf39b3
commit 83dacdba73

View File

@ -292,17 +292,18 @@ void Sub::failsafe_leak_check()
{ {
bool status = leak_detector.get_status(); bool status = leak_detector.get_status();
AP_Notify::flags.leak_detected = status;
// Do nothing if we are dry, or if leak failsafe action is disabled // Do nothing if we are dry, or if leak failsafe action is disabled
if (status == false || g.failsafe_leak == FS_LEAK_DISABLED) { if (status == false || g.failsafe_leak == FS_LEAK_DISABLED) {
if (failsafe.leak) { if (failsafe.leak) {
Log_Write_Error(ERROR_SUBSYSTEM_FAILSAFE_LEAK, ERROR_CODE_FAILSAFE_RESOLVED); Log_Write_Error(ERROR_SUBSYSTEM_FAILSAFE_LEAK, ERROR_CODE_FAILSAFE_RESOLVED);
} }
AP_Notify::flags.leak_detected = false;
failsafe.leak = false; failsafe.leak = false;
return; return;
} }
AP_Notify::flags.leak_detected = status;
uint32_t tnow = AP_HAL::millis(); uint32_t tnow = AP_HAL::millis();
// We have a leak // We have a leak