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 <tom@tsou.cc>
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 @@
 #  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 @@
   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 @@
       pushRadioVector(mTransmitDeadlineClock);
 
       mTransmitDeadlineClock.incTN();
+
+      if (!mTransmitDeadlineClock.TN() &&
+          !(mTransmitDeadlineClock.FN() % CLK_IND_INTERVAL)) {
+        writeClockInterface();
+      }
     }
   }