From 6a2bf0d87b215860e76d1866885ae552b0ba63fe Mon Sep 17 00:00:00 2001 From: Alexander Chemeris Date: Sun, 24 May 2015 19:28:09 -0400 Subject: transceiver: Drive clock indication form the receive thread. Receive thread receives data from the device, which is a more stable source of clocking than the transmit side. If transmit side has a hiccup, osmo-trx doesn't send the clock indication, and transmit side is getting completely lost in time. With this patch we ensure that clock indication keeps coming. Signed-off-by: Tom Tsou --- Transceiver52M/Transceiver.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/Transceiver52M/Transceiver.cpp b/Transceiver52M/Transceiver.cpp index 66a2e21..4288f1d 100644 --- a/Transceiver52M/Transceiver.cpp +++ b/Transceiver52M/Transceiver.cpp @@ -861,15 +861,6 @@ bool Transceiver::driveTxPriorityQueue(size_t chan) for (int i = 0; i < 4; i++) frameNum = (frameNum << 8) | (0x0ff & buffer[i+1]); - // periodically update GSM core clock - LOG(DEBUG) << "mTransmitDeadlineClock " << mTransmitDeadlineClock - << " mLastClockUpdateTime " << mLastClockUpdateTime; - - if (!chan) { - if (mTransmitDeadlineClock > mLastClockUpdateTime + GSM::Time(216,0)) - writeClockInterface(); - } - LOG(DEBUG) << "rcvd. burst at: " << GSM::Time(frameNum,timeSlot); int RSSI = (int) buffer[5]; @@ -890,8 +881,12 @@ bool Transceiver::driveTxPriorityQueue(size_t chan) void Transceiver::driveReceiveRadio() { - if (!mRadioInterface->driveReceiveRadio()) + if (!mRadioInterface->driveReceiveRadio()) { usleep(100000); + } else { + if (mTransmitDeadlineClock > mLastClockUpdateTime + GSM::Time(216,0)) + writeClockInterface(); + } } void Transceiver::driveReceiveFIFO(size_t chan) -- cgit v1.2.3