jcaridadhdez / RAK811-tracker

Example code for RAK811 nodes with GPS on board, transmitting their coordinates in the payload of the LoRaWAN packet in a format that is compatible with TTN Mapper.
MIT License
14 stars 13 forks source link

HDOP is an int, not a double #3

Open jpmeijers opened 6 years ago

jpmeijers commented 6 years ago

In gps.c:

int8_t GpsGetLatestGpsHorizontalDilution (void)
{
    BoardDisableIrq( );
    if( HasFix == true )
    {    
        Hdop = atoi( NmeaGpsData.NmeaHorizontalDilution );
    }
    else
    {
        Hdop = 0xFFFF;
    }
    BoardEnableIrq( );

    return Hdop;

}

We should change this to double GpsGetLatestGpsHorizontalDilution (void) and parse a float, not an int Hdop = atof( NmeaGpsData.NmeaHorizontalDilution );

jcaridadhdez commented 6 years ago

You are right! Thank you! in gps.h changed: int8_t GpsGetLatestGpsHorizontalDilution (void) to float GpsGetLatestGpsHorizontalDilution (void)

In gps.c the function: int8_t GpsGetLatestGpsHorizontalDilution (void) And the parser line: Hdop = atoi( NmeaGpsData.NmeaHorizontalDilution ); have been changed to: float GpsGetLatestGpsHorizontalDilution (void) And: Hdop = atof( NmeaGpsData.NmeaHorizontalDilution );