diff options
author | Tom Tsou <tom@tsou.cc> | 2014-10-31 13:18:43 -0700 |
---|---|---|
committer | Tom Tsou <tom@tsou.cc> | 2014-10-31 13:26:50 -0700 |
commit | 774a06369a04e49f0843eb40f9cbd4379e5f7ab9 (patch) | |
tree | 61577bac9d213521dbab48c8868ca299d1f14cfe | |
parent | 94ce835050e397ae939f2fb39902775c9ba00022 (diff) |
ms: Move clock indications generation to lower drive loopms
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 <tom@tsou.cc>
-rw-r--r-- | Transceiver52M/Transceiver.cpp | 17 |
1 files 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(); + } } } |