some redefinition done in the struct and some troubleshooting
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -17,8 +17,12 @@ typedef enum {
|
||||
}nmea_msg_type;
|
||||
|
||||
typedef struct{
|
||||
uint8_t deg; // Degrees: 0–90 (latitude) or 0–180 (longitude)
|
||||
uint32_t min_x10000; // Minutes × 10,000 (e.g., 16.4512 → 164512)
|
||||
uint8_t lat_deg; // Degrees: 0–90 (latitude) or 0–180 (longitude)
|
||||
uint32_t lat_min_x10000; // Minutes × 10,000 (e.g., 16.4512 → 164512)
|
||||
|
||||
uint8_t lon_deg; // Degrees: 0–90 (latitude) or 0–180 (longitude)
|
||||
uint32_t lon_min_x10000; // Minutes × 10,000 (e.g., 16.4512 → 164512)
|
||||
|
||||
char dir; // 'N', 'S', 'E', or 'W'
|
||||
}cm_nmea_coord;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user