From 83dacdba73e6a0718a9804a6f5b971ead782718f Mon Sep 17 00:00:00 2001 From: Jacob Walser Date: Mon, 18 Sep 2017 14:02:03 -0400 Subject: [PATCH] Sub: Fix AP_Notify leak flag logic --- ArduSub/failsafe.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ArduSub/failsafe.cpp b/ArduSub/failsafe.cpp index b4fa4ccc4a..59b47cdb30 100644 --- a/ArduSub/failsafe.cpp +++ b/ArduSub/failsafe.cpp @@ -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