used ChatGPT to add comments and proper Headers to all SourceFiles
This commit is contained in:
@@ -1,7 +1,26 @@
|
||||
/**
|
||||
* @file gps.cpp
|
||||
*
|
||||
* @brief Implementation file for GPS-related functions in the ChainLube application.
|
||||
*
|
||||
* This file contains the implementation of functions related to GPS functionality within the ChainLube
|
||||
* application. It includes the initialization of the GPS module, processing GPS data for wheel speed,
|
||||
* and maintaining Diagnostic Trouble Codes (DTCs) based on GPS communication status.
|
||||
*
|
||||
* @author Marcel Peterkau
|
||||
* @date 09.01.2024
|
||||
*/
|
||||
|
||||
#include "gps.h"
|
||||
|
||||
TinyGPSPlus gps;
|
||||
|
||||
/**
|
||||
* @brief Initializes the GPS module with the specified baud rate.
|
||||
*
|
||||
* This function initializes the GPS module with the baud rate configured in the application settings.
|
||||
* It also prints a debug message indicating the initialization status.
|
||||
*/
|
||||
void Init_GPS()
|
||||
{
|
||||
uint32_t baudrate;
|
||||
@@ -22,6 +41,15 @@ void Init_GPS()
|
||||
Serial.begin(baudrate);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Processes GPS data to calculate rear wheel speed and returns the distance traveled.
|
||||
*
|
||||
* This function processes GPS data received from the GPS module, calculates the rear wheel speed in
|
||||
* kilometers per hour, and returns the distance traveled based on the speed and time elapsed since
|
||||
* the last valid speed measurement.
|
||||
*
|
||||
* @return The distance traveled in millimeters since the last GPS speed measurement.
|
||||
*/
|
||||
uint32_t Process_GPS_WheelSpeed()
|
||||
{
|
||||
static uint32_t lastRecTimestamp;
|
||||
@@ -49,7 +77,9 @@ uint32_t Process_GPS_WheelSpeed()
|
||||
lastRecTimestamp = millis();
|
||||
}
|
||||
}
|
||||
|
||||
// Maintain DTC for no GPS data received within a certain time frame
|
||||
MaintainDTC(DTC_NO_GPS_SERIAL, (millis() > lastRecTimestamp + 10000));
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user