diff --git a/flight/OpenPilot/Modules/GPS/GPS.c b/flight/OpenPilot/Modules/GPS/GPS.c index b9255eabc..fb252cb41 100644 --- a/flight/OpenPilot/Modules/GPS/GPS.c +++ b/flight/OpenPilot/Modules/GPS/GPS.c @@ -61,8 +61,8 @@ static int32_t addObject(UAVObjHandle obj); static int32_t setUpdatePeriod(UAVObjHandle obj, int32_t updatePeriodMs); // functions -void nmeaInit(void); char* nmeaGetPacketBuffer(void); +char nmeaChecksum(char* gps_buffer); uint8_t nmeaProcess(cBuffer* rxBuffer); void nmeaProcessGPGGA(char* packet); void nmeaProcessGPVTG(char* packet); @@ -215,6 +215,38 @@ char* nmeaGetPacketBuffer(void) return NmeaPacket; } +/** + * Prosesses NMEA sentence checksum + * \param[in] Buffer for parsed nmea sentence + * \return 0 checksum not valid + * \return 1 checksum valid + */ +char nmeaChecksum(char* gps_buffer) +{ + char checksum=0; + char checksum_received=0; + + for(int x=0; x