Fix small negative GPS values (#5810)

This commit is contained in:
3djc
2018-04-12 22:05:15 +04:00
committed by Andre Bernet
parent 9e4a0680ab
commit 1835cb12be
+4 -2
View File
@@ -308,9 +308,11 @@ void logsWrite()
if (sensor.unit == UNIT_GPS) {
if (telemetryItem.gps.longitude && telemetryItem.gps.latitude) {
div_t qr = div((int)telemetryItem.gps.latitude, 1000000);
f_printf(&g_oLogFile, "%d.%06d ", qr.quot, abs(qr.rem));
if (telemetryItem.gps.latitude < 0) f_printf(&g_oLogFile, "-");
f_printf(&g_oLogFile, "%d.%06d ", abs(qr.quot), abs(qr.rem));
qr = div((int)telemetryItem.gps.longitude, 1000000);
f_printf(&g_oLogFile, "%d.%06d,", qr.quot, abs(qr.rem));
if (telemetryItem.gps.longitude < 0) f_printf(&g_oLogFile, "-");
f_printf(&g_oLogFile, "%d.%06d,", abs(qr.quot), abs(qr.rem));
}
else {
f_printf(&g_oLogFile, ",");