1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-25 01:05:10 +03:00

Temporary fix for Sky9X compilation issue

This commit is contained in:
3djc 2019-05-19 11:53:30 +02:00
parent 7dcbfc6806
commit e6c7d6ad08

View file

@ -355,11 +355,19 @@ void TelemetryItem::eval(const TelemetrySensor & sensor)
}
}
uint32_t angle = abs(gpsItem.gps.latitude - gpsItem.pilotLatitude);
#if defined(PCBSKY9X) //TODO remove when sky9x issue is understood
uint32_t dist = (PRECALCULATED_EARTH_RADIUS_CONSTANT * angle) / 1000000;
#else
uint32_t dist = ((uint64_t)PRECALCULATED_EARTH_RADIUS_CONSTANT * angle) / 1000000;
#endif
uint32_t result = dist * dist;
angle = abs(gpsItem.gps.longitude - gpsItem.pilotLongitude);
dist = ((uint64_t ) gpsItem.distFromEarthAxis * angle) / 1000000;
#if defined(PCBSKY9X)
dist = (gpsItem.distFromEarthAxis * angle) / 1000000;
#else
dist = ((uint64_t)gpsItem.distFromEarthAxis * angle) / 1000000;
#endif
result += dist * dist;
// Length on ground (ignoring curvature of the earth)