Fixed compiler errors/warnings (declaration of _uidx, scope of index variables i)
Dependents: GPSDevice LogData_UM6-to-SDcard UM6withGPS mbed-cansat-test-GPS ... more
Fork of MODGPS by
Diff: GPS_VTG.cpp
- Revision:
- 3:28a1b60b0f37
- Parent:
- 2:8aa059e7d8b1
--- a/GPS_VTG.cpp Fri Apr 15 12:23:52 2011 +0000 +++ b/GPS_VTG.cpp Sat Apr 16 09:37:33 2011 +0000 @@ -21,6 +21,7 @@ */ #include "GPS_VTG.h" +#include <math.h> GPS_VTG::GPS_VTG() { @@ -35,10 +36,11 @@ { if (n == NULL) n = new GPS_VTG; - do { - memcpy(n, this, sizeof(GPS_VTG)); - } - while (memcmp(n, this, sizeof(GPS_VTG))); + n->_velocity_knots = _velocity_knots; + n->_velocity_kph = _velocity_kph; + n->_track_true = _track_true; + n->_track_mag = _track_mag; + return n; } @@ -64,9 +66,9 @@ token_counter++; } + if (trk_t) { _track_true = atof(trk_t); } + if (trk_m) { _track_mag = atof(trk_m); } if (vel_knots) { _velocity_knots = atof(vel_knots); } - if (vel_kph) { _velocity_kph = atof(vel_kph); } - if (trk_t) { _track_true = atof(trk_t); } - if (trk_m) { _track_mag = atof(trk_m); } + if (vel_kph) { _velocity_kph = atof(vel_kph); } }