mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-02-28 19:37:21 +00:00
Fixed negative lat and log deg, min, sec to decimal deg. (#240)
This commit is contained in:
parent
b1e72c788b
commit
9ecf765344
@ -120,11 +120,19 @@ void GeoPos::set_lon(float lon) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
float GeoPos::lat() {
|
float GeoPos::lat() {
|
||||||
return field_lat_degrees.value() + (field_lat_minutes.value() / 60.0) + (field_lat_seconds.value() / 3600.0);
|
if (field_lat_degrees.value() < 0) {
|
||||||
|
return -1 * ( -1 * field_lat_degrees.value() + (field_lat_minutes.value() / 60.0) + (field_lat_seconds.value() / 3600.0));
|
||||||
|
} else {
|
||||||
|
return field_lat_degrees.value() + (field_lat_minutes.value() / 60.0) + (field_lat_seconds.value() / 3600.0);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
float GeoPos::lon() {
|
float GeoPos::lon() {
|
||||||
return field_lon_degrees.value() + (field_lon_minutes.value() / 60.0) + (field_lon_seconds.value() / 3600.0);
|
if (field_lon_degrees.value() < 0) {
|
||||||
|
return -1 * (-1 * field_lon_degrees.value() + (field_lon_minutes.value() / 60.0) + (field_lon_seconds.value() / 3600.0));
|
||||||
|
} else {
|
||||||
|
return field_lon_degrees.value() + (field_lon_minutes.value() / 60.0) + (field_lon_seconds.value() / 3600.0);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
int32_t GeoPos::altitude() {
|
int32_t GeoPos::altitude() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user