kopia lustrzana https://github.com/meshtastic/firmware
fix NMEA Timestamp for good
rodzic
81bfd69a41
commit
b4ff37104a
|
@ -59,8 +59,10 @@ uint32_t printGGA(char *buf, size_t bufsz, const meshtastic_Position &pos)
|
|||
{
|
||||
GeoCoord geoCoord(pos.latitude_i, pos.longitude_i, pos.altitude);
|
||||
tm *t = localtime((time_t *)&pos.timestamp);
|
||||
if (getRTCQuality() > 0) // use the device clock if we got time from somewhere. If not, use the GPS timestamp.
|
||||
t = localtime((time_t *)getValidTime(RTCQuality::RTCQualityDevice));
|
||||
if (getRTCQuality() > 0) { // use the device clock if we got time from somewhere. If not, use the GPS timestamp.
|
||||
uint32_t rtc_sec = getValidTime(RTCQuality::RTCQualityDevice);
|
||||
t = localtime((time_t *)&rtc_sec);
|
||||
}
|
||||
|
||||
uint32_t len = snprintf(
|
||||
buf, bufsz, "$GNGGA,%02d%02d%02d.%02d,%02d%07.4f,%c,%03d%07.4f,%c,%u,%02u,%04u,%04d,%c,%04d,%c,%d,%04d", t->tm_hour,
|
||||
|
|
Ładowanie…
Reference in New Issue