Fix small negative GPS values (#5810)
This commit is contained in:
+4
-2
@@ -308,9 +308,11 @@ void logsWrite()
|
|||||||
if (sensor.unit == UNIT_GPS) {
|
if (sensor.unit == UNIT_GPS) {
|
||||||
if (telemetryItem.gps.longitude && telemetryItem.gps.latitude) {
|
if (telemetryItem.gps.longitude && telemetryItem.gps.latitude) {
|
||||||
div_t qr = div((int)telemetryItem.gps.latitude, 1000000);
|
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);
|
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 {
|
else {
|
||||||
f_printf(&g_oLogFile, ",");
|
f_printf(&g_oLogFile, ",");
|
||||||
|
|||||||
Reference in New Issue
Block a user