Revision 3:d01d7593384d, committed 2012-03-28
- Comitter:
- slisgrinder
- Date:
- Wed Mar 28 23:29:35 2012 +0000
- Parent:
- 2:6f49c74ab3b9
- Commit message:
Changed in this revision
diff -r 6f49c74ab3b9 -r d01d7593384d GPSParser.cpp
--- a/GPSParser.cpp Wed Mar 28 21:32:26 2012 +0000
+++ b/GPSParser.cpp Wed Mar 28 23:29:35 2012 +0000
@@ -1,6 +1,6 @@
#include "GPSParser.h"
-GPSParser::GPSParser (PinName tx, PinName rx, int baud, int num_sentence, MODSERIAL &pc)
+GPSParser::GPSParser (PinName tx, PinName rx, int baud, int num_sentence, MODSERIAL &pc, PwmOut &indicator)
:
GLL (0),
RMC (0),
@@ -20,7 +20,8 @@
baudrate (baud),
ctr (0),
gps (tx, rx),
- pc (pc)
+ pc (pc),
+ indicator (indicator)
{
pc.printf ("Initializing GPS...\r\n");
gps.baud (baudrate);
@@ -95,6 +96,7 @@
void GPSParser::ready_buffer(MODSERIAL_IRQ_INFO *q)
{
+ indicator = 1;
MODSERIAL *serial = q->serial;
if (serial->rxGetLastChar() == '\n')
@@ -105,4 +107,5 @@
process_readings ();
ctr = 0;
}
+ indicator = 0;
}
\ No newline at end of file
diff -r 6f49c74ab3b9 -r d01d7593384d GPSParser.h
--- a/GPSParser.h Wed Mar 28 21:32:26 2012 +0000
+++ b/GPSParser.h Wed Mar 28 23:29:35 2012 +0000
@@ -1,48 +1,49 @@
-#include "mbed.h"
-#include "MODSERIAL.h"
-
-class GPSParser
-{
- public:
-
- struct GPS
- {
- float latitude, lat_deg, lat_min, deg_latitude, longitude, long_deg, long_min, deg_longitude, altitude, HDOP, geoidal_sep, AODC, heading, mag_heading, speed_knots, speed_kph;
- char ns, ew, mode;
- int hours, minutes, seconds, m_seconds, fix, sats_used, DGPS_ID;
- unsigned short checksum_gga, checksum_vtg;
- };
-
- struct GPS readings;
-
-
- GPSParser (PinName tx, PinName rx, int baud, int num_sentence, MODSERIAL &pc);
-
- void process_readings ();
-
- void ready_buffer(MODSERIAL_IRQ_INFO *q);
- /*{
- MODSERIAL *serial = q->serial;
-
- if (serial->rxGetLastChar() == '\n')
- ctr++;
-
- if (ctr == num_sentences)
- {
- read_gps();
- ctr = 0;
- }
- };*/
-
- protected:
-
- int GLL, RMC, VTG, GGA, GSA, GSV, GRS, GST, MALM, MEPH, MDGP, MDBG, ZDA, MCHN;
- int num_sentences;// = 0;
- volatile int ctr;// = 0;
- int baudrate;
-
- MODSERIAL gps;
- MODSERIAL pc;
-
-
+#include "mbed.h"
+#include "MODSERIAL.h"
+
+class GPSParser
+{
+ public:
+
+ struct GPS
+ {
+ float latitude, lat_deg, lat_min, deg_latitude, longitude, long_deg, long_min, deg_longitude, altitude, HDOP, geoidal_sep, AODC, heading, mag_heading, speed_knots, speed_kph;
+ char ns, ew, mode;
+ int hours, minutes, seconds, m_seconds, fix, sats_used, DGPS_ID;
+ unsigned short checksum_gga, checksum_vtg;
+ };
+
+ struct GPS readings;
+
+
+ GPSParser (PinName tx, PinName rx, int baud, int num_sentence, MODSERIAL &pc, PwmOut &indicator);
+
+ void process_readings ();
+
+ void ready_buffer(MODSERIAL_IRQ_INFO *q);
+ /*{
+ MODSERIAL *serial = q->serial;
+
+ if (serial->rxGetLastChar() == '\n')
+ ctr++;
+
+ if (ctr == num_sentences)
+ {
+ read_gps();
+ ctr = 0;
+ }
+ };*/
+
+ protected:
+
+ int GLL, RMC, VTG, GGA, GSA, GSV, GRS, GST, MALM, MEPH, MDGP, MDBG, ZDA, MCHN;
+ int num_sentences;// = 0;
+ volatile int ctr;// = 0;
+ int baudrate;
+
+ MODSERIAL gps;
+ MODSERIAL pc;
+ PwmOut indicator;
+
+
};
\ No newline at end of file