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 "Task6Pc.h"
guiott 2:8917036cbf69 2
guiott 2:8917036cbf69 3 void ShowPcTask(void)
guiott 2:8917036cbf69 4 {/**
guiott 2:8917036cbf69 5 *\brief TASK 6, if a PC is connected, debug information can be sent to the console
guiott 2:8917036cbf69 6 */
guiott 2:8917036cbf69 7 static int it = 0;
guiott 2:8917036cbf69 8 int i;
guiott 2:8917036cbf69 9 DegMinSec DecCoord;
guiott 2:8917036cbf69 10
guiott 2:8917036cbf69 11 os.SetTimer(SHOW_PC_TMR, 1000, 1000);
guiott 2:8917036cbf69 12 while(1)
guiott 2:8917036cbf69 13 {
guiott 2:8917036cbf69 14 os.WaitEvent(SHOW_PC_EVT);
guiott 2:8917036cbf69 15
guiott 2:8917036cbf69 16 if(pc.readable())
guiott 2:8917036cbf69 17 {// wait for an input
guiott 2:8917036cbf69 18 PcMonitor = (pc.getc()-48); // digit a number to en/dis-able debug
guiott 2:8917036cbf69 19 }
guiott 2:8917036cbf69 20
guiott 2:8917036cbf69 21 if( PcMonitor==1 || PcMonitor>5)
guiott 2:8917036cbf69 22 {// Display Info parameters
guiott 2:8917036cbf69 23 pc.printf(
guiott 2:8917036cbf69 24 "%03d, Lat: %f, Lon: %f, Sig:%d, Fix:%d, Inuse:%d\r\n",
guiott 2:8917036cbf69 25 it++, latitude, longitude, info.sig, info.fix, info.satinfo.inuse );
guiott 2:8917036cbf69 26 for (i = 0; i < NMEA_MAXSAT; i++)
guiott 2:8917036cbf69 27 {
guiott 2:8917036cbf69 28 if (info.satinfo.sat[i].sig > 0)
guiott 2:8917036cbf69 29 pc.printf(" sat_id:%02d, sig:%02d, Inuse:%d\r\n",
guiott 2:8917036cbf69 30 info.satinfo.sat[i].id , info.satinfo.sat[i].sig,
guiott 2:8917036cbf69 31 info.satinfo.sat[i].in_use);
guiott 2:8917036cbf69 32 }
guiott 2:8917036cbf69 33 pc.printf("\r\n");
guiott 2:8917036cbf69 34 }
guiott 2:8917036cbf69 35
guiott 2:8917036cbf69 36 if( PcMonitor==2 || PcMonitor>5)
guiott 2:8917036cbf69 37 {// Display Distance parameters
guiott 2:8917036cbf69 38 Deg2DegMinSec(nmea_radian2degree(Pos[0].lat), &DecCoord);
guiott 2:8917036cbf69 39 pc.printf("Lat1:%d %d\'%.3f\" ", DecCoord.Deg, DecCoord.Min, DecCoord.Sec);
guiott 2:8917036cbf69 40 Deg2DegMinSec(nmea_radian2degree(Pos[0].lon), &DecCoord);
guiott 2:8917036cbf69 41 pc.printf("Lon1:%d %d\'%.3f\" ", DecCoord.Deg, DecCoord.Min, DecCoord.Sec);
guiott 2:8917036cbf69 42 Deg2DegMinSec(nmea_radian2degree(Pos[1].lat), &DecCoord);
guiott 2:8917036cbf69 43 pc.printf("Lat2:%d %d\'%.3f\" ", DecCoord.Deg, DecCoord.Min, DecCoord.Sec);
guiott 2:8917036cbf69 44 Deg2DegMinSec(nmea_radian2degree(Pos[1].lon), &DecCoord);
guiott 2:8917036cbf69 45 pc.printf("Lon2:%d %d\'%.3f\" \n", DecCoord.Deg, DecCoord.Min, DecCoord.Sec);
guiott 2:8917036cbf69 46 pc.printf("Dist:%f Azimuth Start:%f Azimuth Final:%f \n\n",
guiott 2:8917036cbf69 47 Path.Dist, Path.Azimuth[0], Path.Azimuth[1]);
guiott 2:8917036cbf69 48 }
guiott 2:8917036cbf69 49 }
guiott 2:8917036cbf69 50 }