Allows for a GPS module to be connected to a serial port and exposes an easy to use API to get the GPS data.
Fork of MODGPS by
Diff: GPS.cpp
- Revision:
- 5:7f130f85d5a4
- Parent:
- 3:28a1b60b0f37
- Child:
- 6:64771e31464e
--- a/GPS.cpp Sat Apr 16 09:41:43 2011 +0000 +++ b/GPS.cpp Wed Apr 20 09:15:07 2011 +0000 @@ -141,6 +141,14 @@ } process_required = false; } + + // If we have a valid GPS time then, once per minute, set the RTC. + if (theTime.status == 'A' && theTime.second == 0 && theTime.tenths == 0 && theTime.hundreths == 0) { + // set_time() is defined in rtc_time.h + // http://mbed.org/projects/libraries/svn/mbed/trunk/rtc_time.h + set_time(theTime.to_C_tm()); + } + } void