kosma / minmea

a lightweight GPS NMEA 0183 parser library in pure C
Do What The F*ck You Want To Public License
735 stars 246 forks source link

Microseconds Overflow #33

Closed xvinny-zz closed 2 years ago

xvinny-zz commented 6 years ago

Hi,

I'm using the library with a GY-NEO6MV2 and ESP32, and I got an issue. My GPS is set to 5Hz sample rate, and when I get the time.microseconds, it overflows the value. I changed the scale value from 1000000 to 100 and it worked. Follow the code of minmea.c `

                if (*field++ == '.') {
                    int value = 0;
                    //int scale = 1000000;
                    int scale = 100;
                    while (isdigit((unsigned char) *field) && scale > 1)
                    {
                        value = (value * 10) + (*field++ - '0');
                        scale /= 10;
                    }
                    u = value * scale;
                } else {
                    u = 0;
                }

`

kosma commented 5 years ago

Do you have an example line from the receiver that triggers this bug? I can't reproduce/test/fix without it.

cmorganBE commented 2 years ago

Closing due to inactivity.