common: Rename TimeAndPos::latitude to latitude_deg.
[gps-watch.git] / src / common / gps.rs
index 85e1dd4a07d5d609fbdf3c1a59140c086e03c672..bda3670c25e5ca540da84ebd48a9abeb73fce177 100644 (file)
@@ -46,8 +46,8 @@ pub struct Gps {
 pub struct TimeAndPos {
     pub system_time: u32,
     pub unix_time: u32,
-    pub latitude: i32, // Positive means north, negative means south.
-    pub longitude: i32, // Positive means east, negative means west.
+    pub latitude_deg: i32, // Positive means north, negative means south.
+    pub longitude_deg: i32, // Positive means east, negative means west.
     pub latitude_rad: Fixed, // Positive means north, negative means south.
     pub longitude_rad: Fixed, // Positive means east, negative means west.
 }
@@ -57,8 +57,8 @@ impl TimeAndPos {
         TimeAndPos {
             system_time: 0,
             unix_time: 0,
-            latitude: 0,
-            longitude: 0,
+            latitude_deg: 0,
+            longitude_deg: 0,
             latitude_rad: Fixed::from_i64(0),
             longitude_rad: Fixed::from_i64(0),
         }
@@ -430,18 +430,18 @@ impl Gps {
 
                 tap.system_time = systick::now();
                 tap.unix_time = unix_time;
-                tap.latitude = parse_coordinate(latitude);
-                tap.longitude = parse_coordinate(longitude);
+                tap.latitude_deg = parse_coordinate(latitude);
+                tap.longitude_deg = parse_coordinate(longitude);
                 tap.latitude_rad = parse_coordinate_q(latitude).to_radians();
                 tap.longitude_rad = parse_coordinate_q(longitude).to_radians();
 
                 if north_south == b"S" {
-                    tap.latitude = -tap.latitude;
+                    tap.latitude_deg = -tap.latitude_deg;
                     tap.latitude_rad = -tap.latitude_rad;
                 }
 
                 if east_west == b"W" {
-                    tap.longitude = -tap.longitude;
+                    tap.longitude_deg = -tap.longitude_deg;
                     tap.longitude_rad = -tap.longitude_rad;
                 }