Telemetry simulator latitude and longitude were exchanged with each other

This commit is contained in:
Damjan Adamic
2016-10-06 10:31:26 +02:00
parent f3c2a4db93
commit e7f6d321dd
+3 -3
View File
@@ -496,11 +496,11 @@ TelemetrySimulator::GPSEmulator::GPSEmulator()
uint32_t TelemetrySimulator::GPSEmulator::encodeLatLon(double latLon, bool isLat) uint32_t TelemetrySimulator::GPSEmulator::encodeLatLon(double latLon, bool isLat)
{ {
uint32_t data = (uint32_t)((latLon < 0 ? -latLon : latLon) * 60 * 10000) & 0x3FFFFFFF; uint32_t data = (uint32_t)((latLon < 0 ? -latLon : latLon) * 60 * 10000) & 0x3FFFFFFF;
if (isLat == false) { if (isLat) {
data |= 0x80000000; data |= (1 << 31);
} }
if (latLon < 0) { if (latLon < 0) {
data |= 0x40000000; data |= (1 << 30);
} }
return data; return data;
} }