diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2015-01-23 10:18:17 +0100 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2015-01-23 10:51:26 +0100 |
commit | e12c679b8cc8a263507c556cb24819dc0d5559b9 (patch) | |
tree | 8f2cd06710d15ca64a4a86c1ce52bc975ec3f2b0 /src/TimestampDecoder.h | |
parent | d82422fbb3d9d34a0566197245376548ce3ef14e (diff) | |
parent | 94c1f63b6fd07d74f3325274dd19fd6beaf53965 (diff) | |
download | dabmod-e12c679b8cc8a263507c556cb24819dc0d5559b9.tar.gz dabmod-e12c679b8cc8a263507c556cb24819dc0d5559b9.tar.bz2 dabmod-e12c679b8cc8a263507c556cb24819dc0d5559b9.zip |
Merge raspine's ZeroMQ RC and UHD staticdelay
Merge raspine/master pull request, fix indentation, code style, and two
minor conflicts in:
doc/example.ini
src/DabMod.cpp
Diffstat (limited to 'src/TimestampDecoder.h')
-rw-r--r-- | src/TimestampDecoder.h | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/src/TimestampDecoder.h b/src/TimestampDecoder.h index 52290ac..0c393e4 100644 --- a/src/TimestampDecoder.h +++ b/src/TimestampDecoder.h @@ -2,8 +2,10 @@ Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Her Majesty the Queen in Right of Canada (Communications Research Center Canada) - Includes modifications for which no copyright is claimed - 2012, Matthias P. Braendli, matthias.braendli@mpb.li + Copyright (C) 2014 + Matthias P. Braendli, matthias.braendli@mpb.li + + http://opendigitalradio.org */ /* This file is part of ODR-DabMod. @@ -52,6 +54,9 @@ struct modulator_offset_config struct frame_timestamp { + // Which frame count does this timestamp apply to + uint32_t fct; + uint32_t timestamp_sec; double timestamp_pps_offset; bool timestamp_valid; @@ -64,6 +69,7 @@ struct frame_timestamp this->timestamp_pps_offset = rhs.timestamp_pps_offset; this->timestamp_valid = rhs.timestamp_valid; this->timestamp_refresh = rhs.timestamp_refresh; + this->fct = rhs.fct; } return *this; @@ -104,7 +110,7 @@ struct frame_timestamp /* This module decodes MNSC time information */ class TimestampDecoder { - public: + public: TimestampDecoder( struct modulator_offset_config& config, Logger& logger): @@ -113,6 +119,7 @@ class TimestampDecoder inhibit_second_update = 0; time_pps = 0.0; time_secs = 0; + latestFCT = 0; enableDecode = false; full_timestamp_received_mnsc = false; gmtime_r(0, &temp_time); @@ -129,7 +136,11 @@ class TimestampDecoder void calculateTimestamp(struct frame_timestamp& ts); /* Update timestamp data from data in ETI */ - void updateTimestampEti(int framephase, uint16_t mnsc, double pps); + void updateTimestampEti( + int framephase, + uint16_t mnsc, + double pps, + uint32_t fct); /* Update the modulator timestamp offset according to the modconf */ @@ -147,7 +158,7 @@ class TimestampDecoder * the timestamp */ void updateTimestampPPS(double pps); - + /* Update the timestamp when a full set of MNSC data is * known. This function can be called at most every four * frames when the data is transferred using the MNSC. @@ -156,6 +167,7 @@ class TimestampDecoder struct tm temp_time; uint32_t time_secs; + uint32_t latestFCT; double time_pps; double timestamp_offset; int inhibit_second_update; |