mirror of
https://github.com/meshtastic/firmware.git
synced 2025-04-24 17:32:18 +00:00
fix NMEA Timestamp for good
This commit is contained in:
parent
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);
|
GeoCoord geoCoord(pos.latitude_i, pos.longitude_i, pos.altitude);
|
||||||
tm *t = localtime((time_t *)&pos.timestamp);
|
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.
|
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));
|
uint32_t rtc_sec = getValidTime(RTCQuality::RTCQualityDevice);
|
||||||
|
t = localtime((time_t *)&rtc_sec);
|
||||||
|
}
|
||||||
|
|
||||||
uint32_t len = snprintf(
|
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,
|
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,
|
||||||
|
Loading…
Reference in New Issue
Block a user