From 4f4391708e368aa03f6d89deaabc220f75a10f7a Mon Sep 17 00:00:00 2001 From: sambas Date: Sun, 30 May 2010 06:31:58 +0000 Subject: [PATCH] OP-25 Flight/GPS: Heading and GroundSpeed used, speed in knots? git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@687 ebee16cc-31ac-478f-84a7-5cbb03baadba --- flight/OpenPilot/Modules/GPS/GPS.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/flight/OpenPilot/Modules/GPS/GPS.c b/flight/OpenPilot/Modules/GPS/GPS.c index 9127755c5..f8e7c84aa 100644 --- a/flight/OpenPilot/Modules/GPS/GPS.c +++ b/flight/OpenPilot/Modules/GPS/GPS.c @@ -511,10 +511,16 @@ void nmeaProcessGPRMC(char* packet) // next field: speed (knots) // get speed in knots tokens = strsep(&packet, delimiter); + deg=strtol (tokens,&pEnd,10); + desim=strtol (pEnd+1,NULL,10); + GpsData.GroundSpeed = deg+(desim/100.0); //OPGPS style // next field: True course // get True course tokens = strsep(&packet, delimiter); + deg=strtol (tokens,&pEnd,10); + desim=strtol (pEnd+1,NULL,10); + GpsData.Heading = deg+(desim/100.0); //OPGPS style // next field: Date of fix // get Date of fix