some redefinition done in the struct and some troubleshooting

This commit is contained in:
2025-06-29 08:35:21 +02:00
parent 59c08f05f8
commit 97ea1d0ec4
2 changed files with 9 additions and 3 deletions

View File

@@ -23,6 +23,8 @@ static int findLenToChar(const char *str, const char character){
static int sGPGLL_decode(cm_nmea_msg_t *inst, char *str){
printf("%s \r\n ",str);
//Move pointer until we meet a "," or NULL!
while((str != NULL) && (*str != ',')) str++;
@@ -36,7 +38,7 @@ static int sGPGLL_decode(cm_nmea_msg_t *inst, char *str){
str[comma_idx] = '\0';
// Decode first part of latitude
inst->gpgll_msg.coordinates.deg = atoi(str);
inst->gpgll_msg.coordinates.lat_deg = atoi(str);
printf("deg: %d, str: %s \r\n ",comma_idx,str);

View File

@@ -17,8 +17,12 @@ typedef enum {
}nmea_msg_type;
typedef struct{
uint8_t deg; // Degrees: 090 (latitude) or 0180 (longitude)
uint32_t min_x10000; // Minutes × 10,000 (e.g., 16.4512 → 164512)
uint8_t lat_deg; // Degrees: 090 (latitude) or 0180 (longitude)
uint32_t lat_min_x10000; // Minutes × 10,000 (e.g., 16.4512 → 164512)
uint8_t lon_deg; // Degrees: 090 (latitude) or 0180 (longitude)
uint32_t lon_min_x10000; // Minutes × 10,000 (e.g., 16.4512 → 164512)
char dir; // 'N', 'S', 'E', or 'W'
}cm_nmea_coord;