120,7 → 120,11 |
|
// remember statistics (only when engines running) |
if (naviData.FCFlags & FCFLAG_MOTOR_RUN) { |
if (naviData.Altimeter > max_Altimeter) max_Altimeter = naviData.Altimeter; |
if (COSD_FLAGS_CONFIG & COSD_FLAG_GPSHEIGHT) { |
if (naviData.CurrentPosition.Altitude / 1000 - altimeter_offset > max_Altimeter) max_Altimeter = naviData.CurrentPosition.Altitude / 1000; |
} else { |
if (naviData.Altimeter / 20 > max_Altimeter) max_Altimeter = naviData.Altimeter / 20; |
} |
if (naviData.GroundSpeed > max_GroundSpeed) max_GroundSpeed = naviData.GroundSpeed; |
if (naviData.HomePositionDeviation.Distance > max_Distance) { |
max_Distance = naviData.HomePositionDeviation.Distance; |
127,12 → 131,18 |
} |
if (naviData.UBat < min_UBat) min_UBat = naviData.UBat; |
if (naviData.FlyingTime > max_FlyingTime) max_FlyingTime = naviData.FlyingTime; |
if (ampere > max_ampere) max_ampere = ampere; |
if ((COSD_FLAGS_RUNTIME & COSD_FLAG_STROMREC) && !(COSD_FLAGS_MODES & COSD_FLAG_FCCURRENT)) { |
if (ampere > max_ampere) max_ampere = ampere; |
} else if (COSD_FLAGS_MODES & COSD_FLAG_FCCURRENT) { |
if (naviData.Current * 10 > max_ampere) max_ampere = naviData.Current * 10; |
} |
} |
|
// remember last values |
last_RC_Quality = naviData.RC_Quality; |
last_UBat = naviData.UBat; |
old_MKFlags = naviData.FCFlags; |
old_NCFlags = naviData.NCFlags; |
seconds_since_last_data = 0; |
|
return 0; |