Allows for a GPS module to be connected to a serial port and exposes an easy to use API to get the GPS data. New feature, added Mbed/LPC17xx RTC synchronisation

Dependents:   SatGPS AntiTheftGPS FLIGHT_CONTROL_AND_COMMUNICATIONS_SYSTEM GPS-Lora ... more

Revision:
5:7f130f85d5a4
Parent:
2:8aa059e7d8b1
diff -r 1e3a53f150aa -r 7f130f85d5a4 GPS_Time.cpp
--- a/GPS_Time.cpp	Sat Apr 16 09:41:43 2011 +0000
+++ b/GPS_Time.cpp	Wed Apr 20 09:15:07 2011 +0000
@@ -39,6 +39,29 @@
     magvar = 0;
 }
 
+time_t
+GPS_Time::to_C_tm(bool set) 
+{
+    GPS_Time t;
+    tm       ct;
+    time_t   q;
+    
+    timeNow(&t);
+    ct.tm_sec       = t.second;
+    ct.tm_min       = t.minute;
+    ct.tm_hour      = t.hour;
+    ct.tm_mday      = t.day;
+    ct.tm_mon       = t.month - 1;
+    ct.tm_year      = t.year - 1900;
+    ct.tm_isdst     = 0; // GPS has no understanding of DST.    
+    
+    q = mktime(&ct);
+    if (set) {
+        set_time(q);
+    }
+    return q;
+}
+
 GPS_Time *
 GPS_Time::timeNow(GPS_Time *n)
 {