From e0314d8b755ce1fc8007db37efce9459ab336348 Mon Sep 17 00:00:00 2001
From: Raymond Knopp <raymond.knopp@eurecom.fr>
Date: Mon, 21 Nov 2016 12:19:21 +0800
Subject: [PATCH] update to timing drift compensation in rfdevice

---
 targets/RT/USER/lte-enb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/targets/RT/USER/lte-enb.c b/targets/RT/USER/lte-enb.c
index 74e75bdc4d..58494caed4 100644
--- a/targets/RT/USER/lte-enb.c
+++ b/targets/RT/USER/lte-enb.c
@@ -895,8 +895,8 @@ void rx_rf(PHY_VARS_eNB *eNB,int *frame,int *subframe) {
     eNB->ts_offset = proc->timestamp_rx;
   else {
     if (proc->timestamp_rx - old_ts != fp->samples_per_tti) {
-      LOG_I(PHY,"rx_rf: rfdevice timing drift of %d samples\n",proc->timestamp_rx - old_ts);
-      eNB->ts_offset += (proc->timestamp_rx - old_ts);
+      LOG_I(PHY,"rx_rf: rfdevice timing drift of %d samples\n",proc->timestamp_rx - old_ts - fp->samples_per_tti);
+      eNB->ts_offset += (proc->timestamp_rx - old_ts - fp->samples_per_tti);
     }
   }
   proc->frame_rx    = ((proc->timestamp_rx-eNB->ts_offset) / (fp->samples_per_tti*10))&1023;
-- 
GitLab