From 78e5f8c2f7e24003e2c6f627c573239b9bf1bbd8 Mon Sep 17 00:00:00 2001
From: Raymond Knopp <raymond.knopp@eurecom.fr>
Date: Fri, 22 Aug 2014 08:31:58 +0000
Subject: [PATCH] fixed some issues with USRP target

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5747 818b1a75-f10b-46b9-bf7c-635c3b92a50f
---
 targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp | 22 ++++++++++----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
index 7a7125242e..2af10bee75 100644
--- a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
+++ b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
@@ -93,7 +93,7 @@ static int trx_usrp_start(openair0_device *device)
 
   // init recv and send streaming
   uhd::stream_cmd_t cmd(uhd::stream_cmd_t::STREAM_MODE_START_CONTINUOUS);
-  cmd.time_spec = s->usrp->get_time_now() + uhd::time_spec_t(0.001);
+  cmd.time_spec = s->usrp->get_time_now() + uhd::time_spec_t(0.01);
   cmd.stream_now = false; // start at constant delay
   s->rx_stream->issue_stream_cmd(cmd);
 
@@ -177,7 +177,7 @@ static bool is_equal(double a, double b)
  
 int openair0_device_init(openair0_device* device, openair0_config_t *openair0_cfg)
 {
-  //  uhd::set_thread_priority_safe(1.0);
+  uhd::set_thread_priority_safe(1.0);
   usrp_state_t *s = (usrp_state_t*)malloc(sizeof(usrp_state_t));
   memset(s, 0, sizeof(usrp_state_t));
 
@@ -196,15 +196,15 @@ int openair0_device_init(openair0_device* device, openair0_config_t *openair0_cf
   s->usrp->set_clock_source("internal");
   // set master clock rate and sample rate for tx & rx for streaming
   s->usrp->set_master_clock_rate(30.72e6);
-  s->usrp->set_rx_rate(openair0_cfg->sample_rate);
-  s->usrp->set_tx_rate(openair0_cfg->sample_rate);
+  s->usrp->set_rx_rate(openair0_cfg[0].sample_rate);
+  s->usrp->set_tx_rate(openair0_cfg[0].sample_rate);
 
-  s->usrp->set_tx_freq(openair0_cfg->tx_freq[0]);
-  s->usrp->set_rx_freq(openair0_cfg->rx_freq[0]);
-  s->usrp->set_tx_gain(openair0_cfg->tx_gain[0]);
-  s->usrp->set_rx_gain(openair0_cfg->rx_gain[0]);
-  s->usrp->set_tx_bandwidth(openair0_cfg->tx_bw);
-  s->usrp->set_rx_bandwidth(openair0_cfg->rx_bw);
+  s->usrp->set_tx_freq(openair0_cfg[0].tx_freq[0]);
+  s->usrp->set_rx_freq(openair0_cfg[0].rx_freq[0]);
+  s->usrp->set_tx_gain(openair0_cfg[0].tx_gain[0]);
+  s->usrp->set_rx_gain(openair0_cfg[0].rx_gain[0]);
+  s->usrp->set_tx_bandwidth(openair0_cfg[0].tx_bw);
+  s->usrp->set_rx_bandwidth(openair0_cfg[0].rx_bw);
 
   // create tx & rx streamer
   uhd::stream_args_t stream_args("sc16", "sc16");
@@ -237,7 +237,7 @@ int openair0_device_init(openair0_device* device, openair0_config_t *openair0_cf
   device->trx_read_func  = trx_usrp_read;
   device->trx_write_func = trx_usrp_write;
 
-  s->sample_rate = openair0_cfg->sample_rate;
+  s->sample_rate = openair0_cfg[0].sample_rate;
   // TODO:
   // init tx_forward_nsamps based usrp_time_offset ex
   if(is_equal(s->sample_rate, (double)30.72e6))
-- 
GitLab