Export to GitHub

cl-osd - issue #46

Type casting of Google factors in text.h prevent neg adjustment


Posted on Oct 2, 2012 by Helpful Bird

I added a negative GPS_CAL_GOOGLE_LAT value to config.h which resulted in the latitude being 1000s of miles off. I noticed if I use a positive value, the Google coordinate would get adjusted correctly, but any negative value appears to result in completely wrong values.

I did not test GPS_CAL_GOOGLE_LON, but I assume the same happens.

I believe it's the type cast (uint32_t) that converts the value to an unsigned integer (??? my c is rusty). When I changed the operator to '-' my coordinates displayed correctly

number = number - ((uint32_t)(GPS_CAL_GOOGLE_LAT)*60)/100;

Comment #1

Posted on Oct 2, 2012 by Helpful Lion

This issue was closed by revision r110.

Comment #2

Posted on Oct 2, 2012 by Helpful Lion

Good catch! I tried to fix a build error quickly but introduced errors instead. :-) Fixed in r110.

Status: Fixed

Labels:
Type-Defect Priority-Medium