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

Committer:
guiott
Date:
Fri Feb 03 16:29:52 2012 +0000
Revision:
3:a2f9eb3b8a16
Parent:
2:8917036cbf69

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
guiott 2:8917036cbf69 1 #include "mbed.h"
guiott 2:8917036cbf69 2 #include "Common.h"
guiott 2:8917036cbf69 3 #include "nmea/nmea.h"
guiott 2:8917036cbf69 4 #include "mbos.h"
guiott 2:8917036cbf69 5 #include "Tasks.h"
guiott 2:8917036cbf69 6
guiott 2:8917036cbf69 7 Serial gps(NC, GPSRX);
guiott 2:8917036cbf69 8
guiott 2:8917036cbf69 9 //GPS prototypes
guiott 2:8917036cbf69 10 void GpsStringParse(void);
guiott 2:8917036cbf69 11 void GpsDist(void);
guiott 2:8917036cbf69 12 void Deg2DegMinSec(double DecDeg, DegMinSec *DecSec);
guiott 2:8917036cbf69 13 void GpsDist(void);
guiott 2:8917036cbf69 14 void Coordinates(void);
guiott 2:8917036cbf69 15 void GpsSerialIsr(void);
guiott 2:8917036cbf69 16 void trace_h(const char *str, int str_size);
guiott 2:8917036cbf69 17 void error_h(const char *str, int str_size);
guiott 2:8917036cbf69 18 double trunc(double v);
guiott 2:8917036cbf69 19
guiott 2:8917036cbf69 20 extern mbos os;
guiott 2:8917036cbf69 21 extern int PcMonitor;
guiott 2:8917036cbf69 22 extern Serial pc;
guiott 2:8917036cbf69 23
guiott 2:8917036cbf69 24 nmeaINFO info; // Store GPS information
guiott 2:8917036cbf69 25 nmeaPARSER parser;
guiott 2:8917036cbf69 26
guiott 2:8917036cbf69 27 DistAzimuth Path;
guiott 2:8917036cbf69 28 nmeaPOS Pos[2];
guiott 2:8917036cbf69 29 nmeaINFO Dest;
guiott 2:8917036cbf69 30
guiott 2:8917036cbf69 31 char msgBuff[2][BUFF_SIZE]; // Receive data buffer from GPS module
guiott 2:8917036cbf69 32 // Two buffer for double buffering
guiott 2:8917036cbf69 33
guiott 2:8917036cbf69 34 volatile int writePointer = 0; // Write pointer for active data buffer
guiott 2:8917036cbf69 35 volatile unsigned int bufferSelect = 0; // Active buffer selector
guiott 2:8917036cbf69 36
guiott 2:8917036cbf69 37 int size;
guiott 2:8917036cbf69 38 double latitude, longitude;
guiott 2:8917036cbf69 39 double degrees, minutes;