Extended GPS support to UV-380 module

This commit is contained in:
Niccolò Izzo 2021-02-24 08:04:49 +01:00
parent 3438006ef5
commit 6b24895ef3
1 changed files with 4 additions and 0 deletions

View File

@ -24,6 +24,8 @@
#include <state.h> #include <state.h>
#include <strings.h> #include <strings.h>
#define KNOTS2KMH 1.852f
/** /**
* This function parses a GPS NMEA sentence and updates radio state * This function parses a GPS NMEA sentence and updates radio state
*/ */
@ -47,6 +49,8 @@ void gps_taskFunc(char *line, __attribute__((unused)) int len, state_t *state)
// Synchronize RTC with GPS UTC clock // Synchronize RTC with GPS UTC clock
if(state->settings.gps_set_time) if(state->settings.gps_set_time)
rtc_setTime(state->gps_data.timestamp); rtc_setTime(state->gps_data.timestamp);
state->gps_data.tmg_true = minmea_tofloat(&frame.course);
state->gps_data.speed = minmea_tofloat(&frame.speed) * KNOTS2KMH;
} break; } break;
case MINMEA_SENTENCE_GGA: case MINMEA_SENTENCE_GGA: