mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-09 01:18:29 -04:00
Sub: Fix AP_Notify leak flag logic
This commit is contained in:
parent
6536bf39b3
commit
83dacdba73
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user