A porting of a GPS decoding and presenting program within the mbos RTOS. It is not a definitive application but a study program to test NMEA full decoding library and a first approach to an RTOS. Many thanks to Andrew Levido for his support and his patience on teaching me the RTOS principles from the other side of the Earth. It uses NMEA library by Tim (xtimor@gmail.com) ported by Ken Todotani (http://mbed.org/users/todotani/) on public mbed library (http://mbed.org/users/todotani/programs/GPS_nmeaLib/5yo4h) also available, as original universal C library, on http://nmea.sourceforge.net

Dependencies:   mbos Watchdog TextLCD mbed ConfigFile

Revision:
0:d177c0087d1f
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nmea/time.c	Sun Jan 29 16:06:12 2012 +0000
@@ -0,0 +1,63 @@
+/*
+ *
+ * NMEA library
+ * URL: http://nmea.sourceforge.net
+ * Author: Tim (xtimor@gmail.com)
+ * Licence: http://www.gnu.org/licenses/lgpl.html
+ * $Id: time.c 4 2007-08-27 13:11:03Z xtimor $
+ *
+ */
+
+/*! \file time.h */
+
+#include "nmea/time.h"
+
+#ifdef NMEA_WIN
+#   pragma warning(disable: 4201)
+#   pragma warning(disable: 4214)
+#   pragma warning(disable: 4115)
+#   include <windows.h>
+#   pragma warning(default: 4201)
+#   pragma warning(default: 4214)
+#   pragma warning(default: 4115)
+#else
+#   include <time.h>
+#endif
+
+#ifdef NMEA_WIN
+
+void nmea_time_now(nmeaTIME *stm)
+{
+    SYSTEMTIME st;
+
+    GetSystemTime(&st);
+
+    stm->year = st.wYear - 1900;
+    stm->mon = st.wMonth - 1;
+    stm->day = st.wDay;
+    stm->hour = st.wHour;
+    stm->min = st.wMinute;
+    stm->sec = st.wSecond;
+    stm->hsec = st.wMilliseconds / 10;
+}
+
+#else /* NMEA_WIN */
+
+void nmea_time_now(nmeaTIME *stm)
+{
+    time_t lt;
+    struct tm *tt;
+
+    time(&lt);
+    tt = gmtime(&lt);
+
+    stm->year = tt->tm_year;
+    stm->mon = tt->tm_mon;
+    stm->day = tt->tm_mday;
+    stm->hour = tt->tm_hour;
+    stm->min = tt->tm_min;
+    stm->sec = tt->tm_sec;
+    stm->hsec = 0;
+}
+
+#endif
\ No newline at end of file