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

Task1Gps.h

Committer:
guiott
Date:
2012-02-03
Revision:
3:a2f9eb3b8a16
Parent:
2:8917036cbf69

File content as of revision 3:a2f9eb3b8a16:

#include "mbed.h"
#include "Common.h"
#include "nmea/nmea.h"
#include "mbos.h"
#include "Tasks.h"

Serial gps(NC, GPSRX);

//GPS prototypes
void GpsStringParse(void);
void GpsDist(void);
void Deg2DegMinSec(double DecDeg, DegMinSec *DecSec);
void GpsDist(void);
void Coordinates(void);
void GpsSerialIsr(void);
void trace_h(const char *str, int str_size);
void error_h(const char *str, int str_size);
double trunc(double v);

extern mbos os;
extern int PcMonitor;
extern Serial pc;

nmeaINFO info;                  // Store GPS information 
nmeaPARSER parser;
  
DistAzimuth Path;
nmeaPOS Pos[2];
nmeaINFO Dest;

char msgBuff[2][BUFF_SIZE];     // Receive data buffer from GPS module
                                // Two buffer for double buffering
                                
volatile int writePointer = 0;  // Write pointer for active data buffer
volatile unsigned int bufferSelect = 0; // Active buffer selector

int size;
double latitude, longitude;
double degrees, minutes;