aboutsummaryrefslogtreecommitdiffstats
path: root/Transceiver52M/Transceiver.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/Transceiver.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/Transceiver.cpp')
-rw-r--r--Transceiver52M/Transceiver.cpp32
1 files changed, 11 insertions, 21 deletions
diff --git a/Transceiver52M/Transceiver.cpp b/Transceiver52M/Transceiver.cpp
index 2d1690f..e5223b7 100644
--- a/Transceiver52M/Transceiver.cpp
+++ b/Transceiver52M/Transceiver.cpp
@@ -103,8 +103,7 @@ Transceiver::Transceiver(int wBasePort,
{
GSM::Time startTime(random() % gHyperframe,0);
- mRxLowerLoopThread = new Thread(32768);
- mTxLowerLoopThread = new Thread(32768);
+ mLowerLoopThread = new Thread(32768);
mTransmitDeadlineClock = startTime;
mLastClockUpdateTime = startTime;
@@ -235,7 +234,7 @@ void Transceiver::pushRadioVector(GSM::Time &nowTime)
radioVector *burst;
TransceiverState *state;
std::vector<signalVector *> bursts(mChans);
- std::vector<bool> zeros(mChans);
+ std::vector<bool> zeros(mChans, false);
std::vector<bool> filler(mChans, true);
for (size_t i = 0; i < mChans; i ++) {
@@ -252,7 +251,8 @@ void Transceiver::pushRadioVector(GSM::Time &nowTime)
modFN = nowTime.FN() % state->fillerModulus[TN];
bursts[i] = state->fillerTable[modFN][TN];
- zeros[i] = state->chanType[TN] == NONE;
+ if (state->mode == TRX_MODE_BTS)
+ zeros[i] = state->chanType[TN] == NONE;
if ((burst = mTxPriorityQueues[i].getCurrentBurst(nowTime))) {
bursts[i] = burst->getVector();
@@ -672,6 +672,9 @@ SoftVector *Transceiver::pullRadioVector(GSM::Time &wTime, int &RSSI,
diff_time = GSM::Time(sch_time.FN() - burst_time.FN(),
-burst_time.TN());
mRadioInterface->adjustClock(diff_time);
+ mTransmitDeadlineClock = RadioClock::adjust(
+ mTransmitDeadlineClock,
+ diff_time);
state->mode = TRX_MODE_MS_TRACK;
std::cout << "SCH : Locking GSM clock " << std::endl;
@@ -763,10 +766,8 @@ void Transceiver::driveControl(size_t chan)
mRadioInterface->start();
// Start radio interface threads.
- mTxLowerLoopThread->start((void * (*)(void*))
- TxLowerLoopAdapter,(void*) this);
- mRxLowerLoopThread->start((void * (*)(void*))
- RxLowerLoopAdapter,(void*) this);
+ mLowerLoopThread->start((void * (*)(void*))
+ LowerLoopAdapter,(void*) this);
for (size_t i = 0; i < mChans; i++) {
TransceiverChannel *chan = new TransceiverChannel(this, i);
@@ -1041,8 +1042,7 @@ void Transceiver::driveTxFIFO()
}
}
// time to push burst to transmit FIFO
- if (mStates[0].mode == TRX_MODE_BTS)
- pushRadioVector(mTransmitDeadlineClock);
+ pushRadioVector(mTransmitDeadlineClock);
mTransmitDeadlineClock.incTN();
}
@@ -1083,22 +1083,12 @@ void *RxUpperLoopAdapter(TransceiverChannel *chan)
return NULL;
}
-void *RxLowerLoopAdapter(Transceiver *transceiver)
+void *LowerLoopAdapter(Transceiver *transceiver)
{
transceiver->setPriority(0.45);
while (1) {
transceiver->driveReceiveRadio();
- pthread_testcancel();
- }
- return NULL;
-}
-
-void *TxLowerLoopAdapter(Transceiver *transceiver)
-{
- transceiver->setPriority(0.44);
-
- while (1) {
transceiver->driveTxFIFO();
pthread_testcancel();
}