diff options
author | Thomas Tsou <tom@tsou.cc> | 2014-10-06 19:05:52 -0700 |
---|---|---|
committer | Thomas Tsou <tom@tsou.cc> | 2014-10-07 19:35:25 -0700 |
commit | 1303376ad1af451a0487a9015372e2fd068194e2 (patch) | |
tree | b5058d9a9b2a64cff8ce12e6c14ed3f2abe9e08b /Transceiver52M/radioClock.cpp | |
parent | 25021dfe5a2fdd1a0f1e73c74638dab8ad411944 (diff) |
ms: Enable synchronized uplink bursts
Extend the measured SCH timing offset from the downlink to the uplink
path. In order to absorb the frame timing adjustment and remove the
potential of thread contention during the change, combine the lower
FIFO threads into single drive loop.
Force timing changes through to the UHD interface with stream flags
triggered through the updateAlignment() call.
Signed-off-by: Thomas Tsou <tom@tsou.cc>
Diffstat (limited to 'Transceiver52M/radioClock.cpp')
-rw-r--r-- | Transceiver52M/radioClock.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/Transceiver52M/radioClock.cpp b/Transceiver52M/radioClock.cpp index d9d5229..98eaf35 100644 --- a/Transceiver52M/radioClock.cpp +++ b/Transceiver52M/radioClock.cpp @@ -29,14 +29,12 @@ void RadioClock::set(const GSM::Time& wTime) mLock.unlock(); } -void RadioClock::adjust(GSM::Time& wOffset) +GSM::Time RadioClock::adjust(GSM::Time &wBase, GSM::Time &wOffset) { int tn_diff, fn_diff = 0; - mLock.lock(); - /* Modulo TN adustment */ - tn_diff = mClock.TN() + wOffset.TN(); + tn_diff = wBase.TN() + wOffset.TN(); if (tn_diff < 0) { tn_diff += 8; fn_diff--; @@ -46,13 +44,20 @@ void RadioClock::adjust(GSM::Time& wOffset) } /* Modulo FN adjustment */ - fn_diff += mClock.FN() + wOffset.FN(); + fn_diff += wBase.FN() + wOffset.FN(); if (fn_diff < 0) fn_diff += GSM::gHyperframe; else if ((unsigned) fn_diff >= GSM::gHyperframe) fn_diff = fn_diff - GSM::gHyperframe; - mClock = GSM::Time(fn_diff, tn_diff); + return GSM::Time(fn_diff, tn_diff); +} + +void RadioClock::adjust(GSM::Time& wOffset) +{ + mLock.lock(); + + mClock = adjust(mClock, wOffset); updateSignal.signal(); mLock.unlock(); |