Jonit wrote:EOSBandi thank you for fixing that 2km error in serial code, I'll test it as soon as possible!
EDIT: hmm... just loaded new dev_20120622 into my FC and I am still getting that 2km errorwhat am I doing wrong? PS: (I have TinyGPS)
Jonit
GPS.ino have an error.
need to change a fractions order, and 'divisor' size:
GPS.ino: Line>502
Code: Select all
#if defined (TINY_GPS)
int32_t GPS_coord_to_decimal(struct coord *c) {
#define GPS_SCALE_FACTOR 10000000L
uint32_t deg = 0;
deg = (uint32_t)c->deg * GPS_SCALE_FACTOR;
uint32_t min = 0;
min = (uint32_t)c->min * GPS_SCALE_FACTOR;
/* add up the BCD fractions */
uint32_t divisor = (uint32_t)GPS_SCALE_FACTOR/10; // prev. uint16_t divisor = (uint16_t)GPS_SCALE_FACTOR/10;
for (uint8_t i=0; i<NMEA_MINUTE_FRACTS; i++) {
uint8_t b = c->frac[i/2];
uint8_t n = (i%2 == 0 ? b&0x0F : b>>4);// prev. uint8_t n = (i%2 ? b&0x0F : b>>4); or just swap : uint8_t n = (i%2 ? b>>4 : b&0x0F);
min += n*(divisor);
divisor /= 10;
}
/* now sum up degrees and minutes */
return deg + min/60;
}
#endif
Now +-2m
