aboutsummaryrefslogtreecommitdiffstats
path: root/Transceiver52M/radioInterface.cpp
diff options
context:
space:
mode:
authorThomas Tsou <tom@tsou.cc>2014-10-06 19:05:52 -0700
committerThomas Tsou <tom@tsou.cc>2014-10-07 19:35:25 -0700
commit1303376ad1af451a0487a9015372e2fd068194e2 (patch)
treeb5058d9a9b2a64cff8ce12e6c14ed3f2abe9e08b /Transceiver52M/radioInterface.cpp
parent25021dfe5a2fdd1a0f1e73c74638dab8ad411944 (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/radioInterface.cpp')
-rw-r--r--Transceiver52M/radioInterface.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/Transceiver52M/radioInterface.cpp b/Transceiver52M/radioInterface.cpp
index 75266dd..3d91cd1 100644
--- a/Transceiver52M/radioInterface.cpp
+++ b/Transceiver52M/radioInterface.cpp
@@ -38,7 +38,8 @@ RadioInterface::RadioInterface(RadioDevice *wRadio,
int wReceiveOffset, GSM::Time wStartTime)
: mRadio(wRadio), mSPSTx(sps), mSPSRx(1), mChans(chans), mMIMO(diversity),
sendCursor(0), recvCursor(0), underrun(false), overrun(false),
- receiveOffset(wReceiveOffset), shiftOffset(0), mOn(false)
+ receiveOffset(wReceiveOffset), shiftOffset(0), shiftUpdate(false),
+ mOn(false)
{
mClock.set(wStartTime);
}
@@ -301,6 +302,12 @@ bool RadioInterface::isUnderrun()
return retVal;
}
+void RadioInterface::applyOffset(int offset)
+{
+ shiftOffset += offset;
+ shiftUpdate = true;
+}
+
VectorFIFO* RadioInterface::receiveFIFO(size_t chan)
{
if (chan >= mReceiveFIFO.size())
@@ -374,11 +381,16 @@ void RadioInterface::pushBuffer()
powerScaling[i], 2 * sendCursor);
}
+ if (shiftUpdate) {
+ mRadio->updateAlignment(0);
+ shiftUpdate = false;
+ }
+
/* Send the all samples in the send buffer */
num_sent = mRadio->writeSamples(convertSendBuffer,
sendCursor,
&underrun,
- writeTimestamp);
+ writeTimestamp + mSPSTx * shiftOffset);
writeTimestamp += num_sent;
sendCursor = 0;
}