From 62b6a31a18148aacdfd433d25841766a6cf99848 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Tue, 16 Jan 2018 12:05:06 +0100 Subject: Fix invalid timestamp decoding on startup When the second rollover happens before the MNSC was decoded entirely, we set full_timestamp_received without setting time_secs. --- src/TimestampDecoder.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/TimestampDecoder.cpp') diff --git a/src/TimestampDecoder.cpp b/src/TimestampDecoder.cpp index 523551c..5bede08 100644 --- a/src/TimestampDecoder.cpp +++ b/src/TimestampDecoder.cpp @@ -120,7 +120,6 @@ void TimestampDecoder::pushMNSCData(uint8_t framephase, uint16_t mnsc) if (enableDecode) { - full_timestamp_received = true; updateTimestampSeconds(mktime(&temp_time)); } break; @@ -142,6 +141,7 @@ void TimestampDecoder::updateTimestampSeconds(uint32_t secs) { MDEBUG("TimestampDecoder::updateTimestampSeconds(%d) apply\n", secs); time_secs = secs; + full_timestamp_received = true; } } -- cgit v1.2.3