mirror of
https://github.com/thooge/esp32-nmea2000-obp60.git
synced 2026-09-11 19:55:14 +02:00
fix calculate AWD conditionless
This commit is contained in:
@@ -467,10 +467,6 @@ bool WindUtils::handleWinds(bool calcWinds)
|
||||
double twd, tws, twa, awd;
|
||||
bool twCalculated = false;
|
||||
|
||||
if (!calcWinds) { // don't calculate anything if true wind calculation has not been set in configuration
|
||||
return twCalculated;
|
||||
}
|
||||
|
||||
double awaVal = awaBVal->valid ? awaBVal->value : DBL_MAX;
|
||||
double awsVal = awsBVal->valid ? awsBVal->value : DBL_MAX;
|
||||
double cogVal = cogBVal->valid ? cogBVal->value : DBL_MAX;
|
||||
@@ -504,6 +500,10 @@ bool WindUtils::handleWinds(bool calcWinds)
|
||||
}
|
||||
}
|
||||
|
||||
if (!calcWinds) { // don't calculate true winds if not set in configuration
|
||||
return twCalculated;
|
||||
}
|
||||
|
||||
// calculate TWD if not existing and if possible
|
||||
if (!twdBVal->valid) {
|
||||
// calculate TWD if it does not exist yet and TWA is available
|
||||
|
||||
Reference in New Issue
Block a user