From ec604486b66a22c51785edb36d9e5333686bcaa0 Mon Sep 17 00:00:00 2001 From: Scavanger Date: Sun, 10 Nov 2024 17:38:57 -0300 Subject: [PATCH] MacOs (again) --- cmake/sitl.cmake | 1 - src/main/navigation/navigation_geozone.c | 10 +++++----- src/main/navigation/navigation_geozone_calculations.h | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/cmake/sitl.cmake b/cmake/sitl.cmake index 1f377103246..39e6456830a 100644 --- a/cmake/sitl.cmake +++ b/cmake/sitl.cmake @@ -69,7 +69,6 @@ if(NOT MACOSX) endif() else() set(SITL_COMPILE_OPTIONS ${SITL_COMPILE_OPTIONS} - -Wno-error=double-promotion ) endif() diff --git a/src/main/navigation/navigation_geozone.c b/src/main/navigation/navigation_geozone.c index 70d9dac0115..31a60b4084d 100755 --- a/src/main/navigation/navigation_geozone.c +++ b/src/main/navigation/navigation_geozone.c @@ -566,7 +566,7 @@ uint32_t geozoneGetDetectionDistance(void) { uint32_t detctionDistance = 0; if (STATE(AIRPLANE)) { - detctionDistance = navConfig()->fw.loiter_radius * 1.5; + detctionDistance = navConfig()->fw.loiter_radius * 1.5f; } else { detctionDistance = geoZoneConfig()->copterFenceStopDistance; } @@ -1450,9 +1450,9 @@ void geozoneUpdate(timeUs_t curentTimeUs) if (targetZone != NULL && !lockRTZ && (flyOutNfz || (!geozone.insideFz && targetZone->config.fenceAction != GEOFENCE_ACTION_NONE))) { int32_t targetAltitude = 0; if (getEstimatedActualPosition(Z) >= targetZone->config.maxAltitude - geoZoneConfig()->safeAltitudeDistance) { - targetAltitude = targetZone->config.maxAltitude - geoZoneConfig()->safeAltitudeDistance * 1.5; + targetAltitude = targetZone->config.maxAltitude - geoZoneConfig()->safeAltitudeDistance * 1.5f; } else if (getEstimatedActualPosition(Z) <= targetZone->config.minAltitude + geoZoneConfig()->safeAltitudeDistance) { - targetAltitude = targetZone->config.minAltitude + geoZoneConfig()->safeAltitudeDistance * 1.5; + targetAltitude = targetZone->config.minAltitude + geoZoneConfig()->safeAltitudeDistance * 1.5f; } else { targetAltitude = getEstimatedActualPosition(Z); } @@ -1462,9 +1462,9 @@ void geozoneUpdate(timeUs_t curentTimeUs) if (ABS(geozone.distanceVertToNearestZone) < 2000) { calculateFarAwayTarget(&targetPos, posControl.actualState.cog, 100000); if(geozone.distanceVertToNearestZone > 0) { - targetAltitude = getEstimatedActualPosition(Z) + ABS(geozone.distanceVertToNearestZone) + geoZoneConfig()->safeAltitudeDistance * 1.5; + targetAltitude = getEstimatedActualPosition(Z) + ABS(geozone.distanceVertToNearestZone) + geoZoneConfig()->safeAltitudeDistance * 1.5f; } else { - targetAltitude = getEstimatedActualPosition(Z) - ABS(geozone.distanceVertToNearestZone) - geoZoneConfig()->safeAltitudeDistance * 1.5; + targetAltitude = getEstimatedActualPosition(Z) - ABS(geozone.distanceVertToNearestZone) - geoZoneConfig()->safeAltitudeDistance * 1.5f; } } else { diff --git a/src/main/navigation/navigation_geozone_calculations.h b/src/main/navigation/navigation_geozone_calculations.h index 789da2b36a4..6d3cd7ad98f 100755 --- a/src/main/navigation/navigation_geozone_calculations.h +++ b/src/main/navigation/navigation_geozone_calculations.h @@ -24,7 +24,7 @@ #include "common/vector.h" #include "navigation/navigation_private.h" -#define K_EPSILON 1e-8 +#define K_EPSILON 1e-8f static bool isPointInCircle(const fpVector2_t *point, const fpVector2_t *center, const float radius) {