Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: GPS_U-blox_NEO-6M_Code
Revision 5:8a73e34b3978, committed 2016-02-16
- Comitter:
- chris215
- Date:
- Tue Feb 16 02:57:35 2016 +0000
- Parent:
- 4:d911d7c4e09d
- Commit message:
- Function renaming. Adding gps update calls.
Changed in this revision
| GPS.cpp | Show annotated file Show diff for this revision Revisions of this file |
| GPS.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/GPS.cpp Mon Feb 15 05:26:36 2016 +0000
+++ b/GPS.cpp Tue Feb 16 02:57:35 2016 +0000
@@ -49,7 +49,7 @@
RxMessageBuffer.data[(insertIndex++)%RX_BUFFER_SIZE] = in;
}
}
-void GPS::PumpGpsMessages(void)
+void GPS::UpdateGPS(void)
{
if(GPSRMCMessage.MessageIsNew > 0)
{
@@ -88,11 +88,13 @@
}
ECEFDistance GPS::DistanceBetweenTwoWP(ECEFPoint p1,ECEFPoint p2)
{
+
return DistanceBetweenTwoECEFPoints(p1,p2);
}
geodPoint GPS::ReadDecGeodLoc(void){
geodPoint newLoc;
+ UpdateGPS();
newLoc.latitude = nmea_to_dec(info.latitude,info.latLoc);
newLoc.longitude = nmea_to_dec(info.longitude,info.lonLoc);
newLoc.altitude = info.GPSAltitude;
@@ -101,6 +103,7 @@
geodPoint GPS::ReadRawGeodLoc(void){
geodPoint newLoc;
+ UpdateGPS();
newLoc.latitude = info.latitude;
newLoc.longitude = info.longitude;
newLoc.altitude = info.GPSAltitude;
@@ -109,12 +112,15 @@
bool GPS::FixIs3d(void){
+ UpdateGPS();
return (info.fix == 3);
}
bool GPS::FixIs2d(void){
+ UpdateGPS();
return (FixIs3d() || (info.fix == 2));
}
bool GPS::GPSFixValid(void){
+ UpdateGPS();
return (info.GPSStatus == 'A');
}
--- a/GPS.h Mon Feb 15 05:26:36 2016 +0000
+++ b/GPS.h Tue Feb 16 02:57:35 2016 +0000
@@ -26,7 +26,7 @@
GPSInfo info; //current gps information
- void PumpGpsMessages(void);
+ void UpdateGPS(void);
private:
void RxIrqHandler(void);