commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r9488 - gnuradio/branches/developers/trondeau/dbs/usrp


From: trondeau
Subject: [Commit-gnuradio] r9488 - gnuradio/branches/developers/trondeau/dbs/usrp/host/lib/legacy
Date: Tue, 2 Sep 2008 19:27:09 -0600 (MDT)

Author: trondeau
Date: 2008-09-02 19:27:08 -0600 (Tue, 02 Sep 2008)
New Revision: 9488

Modified:
   gnuradio/branches/developers/trondeau/dbs/usrp/host/lib/legacy/db_boards.cc
   gnuradio/branches/developers/trondeau/dbs/usrp/host/lib/legacy/db_dbs_rx.cc
   gnuradio/branches/developers/trondeau/dbs/usrp/host/lib/legacy/db_tv_rx.cc
Log:
fixes so the dbs_rx board has a chance of working.

Modified: 
gnuradio/branches/developers/trondeau/dbs/usrp/host/lib/legacy/db_boards.cc
===================================================================
--- gnuradio/branches/developers/trondeau/dbs/usrp/host/lib/legacy/db_boards.cc 
2008-09-02 21:43:20 UTC (rev 9487)
+++ gnuradio/branches/developers/trondeau/dbs/usrp/host/lib/legacy/db_boards.cc 
2008-09-03 01:27:08 UTC (rev 9488)
@@ -24,6 +24,7 @@
 #include <usrp_dbid.h>
 #include <db_basic.h>
 #include <db_tv_rx.h>
+#include <db_dbs_rx.h>
 #include <db_flexrf.h>
 #include <db_flexrf_mimo.h>
 #include <db_xcvr2450.h>
@@ -56,6 +57,8 @@
     db.push_back(db_base_sptr(new db_lf_rx(usrp, which, 1)));
     break;
     
+  case(USRP_DBID_DBS_RX): db.push_back(db_base_sptr(new db_dbs_rx(usrp, 
which))); break;
+
   case(USRP_DBID_TV_RX): db.push_back(db_base_sptr(new db_tv_rx(usrp, which, 
43.75e6, 5.75e6))); break;
   case(USRP_DBID_TV_RX_REV_2): db.push_back(db_base_sptr(new db_tv_rx(usrp, 
which, 44e6, 20e6))); break;
   case(USRP_DBID_TV_RX_REV_3): db.push_back(db_base_sptr(new db_tv_rx(usrp, 
which, 44e6, 20e6))); break;

Modified: 
gnuradio/branches/developers/trondeau/dbs/usrp/host/lib/legacy/db_dbs_rx.cc
===================================================================
--- gnuradio/branches/developers/trondeau/dbs/usrp/host/lib/legacy/db_dbs_rx.cc 
2008-09-02 21:43:20 UTC (rev 9487)
+++ gnuradio/branches/developers/trondeau/dbs/usrp/host/lib/legacy/db_dbs_rx.cc 
2008-09-03 01:27:08 UTC (rev 9488)
@@ -180,11 +180,11 @@
     ret.m = d_m;
     ret.fdac = d_fdac;
     ret.div = _refclk_freq()/d_m*(4+0.145*d_fdac);
-    return ret;
   }
   else {
     fprintf(stderr, "Failed to set bw\n");
   }
+  return ret;
 }
 
 // Gain setting
@@ -385,19 +385,19 @@
   int rmin = std::max(2, (int)(_refclk_freq()/2e6));
   int rmax = std::min(128, (int)(_refclk_freq()/500e3));
   int r = 2;
-  int n=0;
+  int n = 0;
   int best_r = 2;
   int best_n =0;
   int best_delta = 10e6;
-  float delta;
+  int delta;
   
   while(r <= rmax) {
-    n = round(freq/(_refclk_freq()/r));
+    n = (int)rint(freq/(_refclk_freq()/r));
     if(r<rmin || n<256) {
       r = r * 2;
       continue;
     }
-    delta = abs(n*_refclk_freq()/r - freq);
+    delta = (int)fabsf(n*_refclk_freq()/r - freq);
     if(delta < 75e3) {
       best_r = r;
       best_n = n;
@@ -410,9 +410,9 @@
     }
     r = r * 2;
   }
-  _set_r(int(best_r));
+  _set_r(best_r);
 
-  _set_n(int(round(best_n)));
+  _set_n(round(best_n));
  
   int vco;
   if(vcofreq < 2433e6)

Modified: 
gnuradio/branches/developers/trondeau/dbs/usrp/host/lib/legacy/db_tv_rx.cc
===================================================================
--- gnuradio/branches/developers/trondeau/dbs/usrp/host/lib/legacy/db_tv_rx.cc  
2008-09-02 21:43:20 UTC (rev 9487)
+++ gnuradio/branches/developers/trondeau/dbs/usrp/host/lib/legacy/db_tv_rx.cc  
2008-09-03 01:27:08 UTC (rev 9488)
@@ -41,11 +41,11 @@
 str_to_int_seq(std::string str)
 {
   //convert a string to a list of integers
-  std::vector<int> seq(str.size());
+  std::vector<int> seq;
   std::vector<int>::iterator sitr;
   std::string::iterator i;
   for(i=str.begin(); i != str.end(); i++) {
-    int a = atoi(&(*i));
+    int a = (int)(*i);
     seq.push_back(a);
   }
   return seq;





reply via email to

[Prev in Thread] Current Thread [Next in Thread]