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();
AP_Notify::flags.leak_detected = status;
// Do nothing if we are dry, or if leak failsafe action is disabled
if (status == false || g.failsafe_leak == FS_LEAK_DISABLED) {
if (failsafe.leak) {
Log_Write_Error(ERROR_SUBSYSTEM_FAILSAFE_LEAK, ERROR_CODE_FAILSAFE_RESOLVED);
}
AP_Notify::flags.leak_detected = false;
failsafe.leak = false;
return;
}
AP_Notify::flags.leak_detected = status;
uint32_t tnow = AP_HAL::millis();
// We have a leak