no time for comment

This commit is contained in:
2023-08-09 22:41:48 +02:00
parent 98f3cb93f0
commit 2e0b7f7f8d
8 changed files with 91 additions and 16 deletions
+12 -1
View File
@@ -252,7 +252,18 @@ void Navigation::updateMagneticDeclination() {
int16_t Navigation::calculateCourseCorrection(Point& point) {
int16_t targetCourse = point.courseTo(this->targetPoint);
int16_t correctionCourse = targetCourse - this->realAzimuth;
int16_t correctionCourse;
if (this->calcAzimuthState == CalcAzimuthState::Good
|| this->calcAzimuthState == CalcAzimuthState::Super)
{
correctionCourse = targetCourse - this->calcAzimuth;
this->lastUsedCalcAzimuth = true;
} else {
correctionCourse = targetCourse - this->realAzimuth;
this->lastUsedCalcAzimuth = false;
}
if (correctionCourse > 180)
correctionCourse -= 360;
else if (correctionCourse < -180)