summaryrefslogtreecommitdiffstats
path: root/src/TimestampDecoder.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2018-01-16 12:05:06 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2018-01-16 12:05:06 +0100
commit62b6a31a18148aacdfd433d25841766a6cf99848 (patch)
treea9c4f7b98df85c3b7b3c9189ad989e6df479f8d0 /src/TimestampDecoder.cpp
parentc90e8a9f37444653ca0ae419f6d24b288e393dc6 (diff)
downloaddabmod-62b6a31a18148aacdfd433d25841766a6cf99848.tar.gz
dabmod-62b6a31a18148aacdfd433d25841766a6cf99848.tar.bz2
dabmod-62b6a31a18148aacdfd433d25841766a6cf99848.zip
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.
Diffstat (limited to 'src/TimestampDecoder.cpp')
-rw-r--r--src/TimestampDecoder.cpp2
1 files changed, 1 insertions, 1 deletions
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;
}
}