OpenAT_Fan,
Sorry for the delay. I had to focus my attention on a few other issues. But, I am back and took a look at this yesterday. I am still a bit confused on this issue. You are right, the GPS info for the SMS is filled in the function “AppGetNmeaRMS”. I have looked at it a bit closer and realized one thing:
After the “if” statement you coded in your previous reply, is where it builds the string that is sent to the debug UART. The following:
len = wm_sprintf(dst,"$GPRMC,%02u%02u%02u.%03d,%c,%09.4f,%c,%010.4f,%c,%.2f,%.2f,%02u%02u%02u,,",
pvtData->hms[2],pvtData->hms[1],pvtData->hms[0],
erTime->gpsMsec,pvtData->statCh,
fabs(pvtData->lldeg[0]),pvtData->lldir[0],
fabs(pvtData->lldeg[1]),pvtData->lldir[1],
pvtData->knots,pvtData->dir,
pvtData->dmy[0],pvtData->dmy[1],pvtData->dmy[2]%100);
outputs the correct coordinates. So the following:
fabs(pvtData->lldeg[0])
fabs(pvtData-lldeg[1]
is fine. The problem is when the program translates the minute decimal into degree decimal that it messes up:
GpsInformation.position.latitude = (fabs(pvtData->lldeg[0]))/100;
GpsInformation.position.latitude = (u32)GpsInformation.position.latitude + pvtData->llmin[0];
GpsInformation.position.latitude_direction = pvtData->lldir[0];
GpsInformation.position.longitude = (fabs(pvtData->lldeg[1]))/100;
GpsInformation.position.longitude = (u32)GpsInformation.position.longitude + pvtData->llmin[1];
GpsInformation.position.longitude_direction = pvtData->lldir[1];
Well, that is not completely true. For some reason, my latitude is correct but my longitude is way off the mark. I am clueless as to what might cause this as they are both calculated the same. I have ran the ADS and GCC compiled versions and get exactly the same result. Have you ran this program and gotten favorable results?
Thanks,
Scott