From 774a06369a04e49f0843eb40f9cbd4379e5f7ab9 Mon Sep 17 00:00:00 2001 From: Tom Tsou Date: Fri, 31 Oct 2014 13:18:43 -0700 Subject: ms: Move clock indications generation to lower drive loop During BTS operation, active downlink bursts drive the clock indication, but the flow of bursts is not present in MS mode. Shift the indication trigger to the lower non-blocking loop with FN mod 100 as the interval. Signed-off-by: Tom Tsou --- Transceiver52M/Transceiver.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/Transceiver52M/Transceiver.cpp b/Transceiver52M/Transceiver.cpp index 2b89a6f..64be85a 100644 --- a/Transceiver52M/Transceiver.cpp +++ b/Transceiver52M/Transceiver.cpp @@ -43,6 +43,9 @@ using namespace GSM; # define USB_LATENCY_MIN 1,1 #endif +/* Clock indication interval in frames */ +#define CLK_IND_INTERVAL 100 + /* Number of running values use in noise average */ #define NOISE_CNT 20 #define FREQ_CNT 20 @@ -931,15 +934,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]; @@ -1047,6 +1041,11 @@ void Transceiver::driveTxFIFO() pushRadioVector(mTransmitDeadlineClock); mTransmitDeadlineClock.incTN(); + + if (!mTransmitDeadlineClock.TN() && + !(mTransmitDeadlineClock.FN() % CLK_IND_INTERVAL)) { + writeClockInterface(); + } } } -- cgit v1.2.3