S-PORT GPS parsing was wrong: latitude and longitude were exchanged with each other

Telemetry simulator latitude and longitude were exchanged with each other (reverted from commit e7f6d321dd)
This commit is contained in:
Damjan Adamic
2016-10-06 10:51:45 +02:00
parent e7f6d321dd
commit def3ba9d66
2 changed files with 5 additions and 5 deletions
+3 -3
View File
@@ -496,11 +496,11 @@ TelemetrySimulator::GPSEmulator::GPSEmulator()
uint32_t TelemetrySimulator::GPSEmulator::encodeLatLon(double latLon, bool isLat)
{
uint32_t data = (uint32_t)((latLon < 0 ? -latLon : latLon) * 60 * 10000) & 0x3FFFFFFF;
if (isLat) {
data |= (1 << 31);
if (isLat == false) {
data |= 0x80000000;
}
if (latLon < 0) {
data |= (1 << 30);
data |= 0x40000000;
}
return data;
}