[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r9307 - gnuradio/branches/developers/trondeau/dbs/usrp
From: |
trondeau |
Subject: |
[Commit-gnuradio] r9307 - gnuradio/branches/developers/trondeau/dbs/usrp/host/lib/legacy |
Date: |
Sun, 17 Aug 2008 21:14:17 -0600 (MDT) |
Author: trondeau
Date: 2008-08-17 21:14:16 -0600 (Sun, 17 Aug 2008)
New Revision: 9307
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.h
Log:
cleaning up for C++
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-08-18 03:09:51 UTC (rev 9306)
+++ gnuradio/branches/developers/trondeau/dbs/usrp/host/lib/legacy/db_tv_rx.cc
2008-08-18 03:14:16 UTC (rev 9307)
@@ -22,14 +22,13 @@
#include <sstream>
#include <assert.h>
-/**************************************************************************************************/
+/*****************************************************************************/
std::string
int_seq_to_str(std::vector<int> &seq)
{
//convert a sequence of integers into a string
- //return ''.join (map (chr, seq));
-
+
std::stringstream str;
std::vector<int>::iterator i;
for(i = seq.begin(); i != seq.end(); i++) {
@@ -98,19 +97,20 @@
}
-/**************************************************************************************************/
+/*****************************************************************************/
-db_tv_rx::db_tv_rx(usrp_basic *usrp, int which, float first_IF, float
second_IF)
+db_tv_rx::db_tv_rx(usrp_basic *usrp, int which,
+ float first_IF, float second_IF)
: db_base(usrp, which, false)
{
// Handler for Tv Rx daughterboards.
//
// @param usrp: instance of usrp.source_c
- // @param which: which side: 0 or 1 corresponding to RX_A or RX_B
respectively
+ // @param which: which side: 0, 1 corresponding to RX_A or RX_B respectively
d_usrp = (usrp_basic_rx*)usrp;
- d_tx = false;
+ d_tx = false; // FIXME: this should be redundant
if(which == 0) {
d_i2c_addr = 0x60;
@@ -124,12 +124,16 @@
d_reference_divisor = 640;
d_fast_tuning = false;
d_inverted = false; // FIXME get rid of this
-
+
set_gain((gain_min() + gain_max()) / 2.0); // initialize gain
bypass_adc_buffers(false);
}
+db_tv_rx::~db_tv_rx()
+{
+}
+
// Gain setting
void
db_tv_rx::_set_rfagc(float gain)
@@ -198,7 +202,7 @@
//
// @returns (ok, actual_baseband_freq) where:
// ok is True or False and indicates success or failure,
- // actual_baseband_freq is the RF frequency that corresponds to DC in the
IF.
+ // actual_baseband_freq is RF frequency that corresponds to DC in the IF.
freq_result_t args = {false, 0};
@@ -208,8 +212,8 @@
return args;
}
- float target_lo_freq = target_freq + d_first_IF; // High side mixing
- float f_ref = 4e6 / d_reference_divisor; // frequency steps
+ float target_lo_freq = target_freq + d_first_IF; // High side mixing
+ float f_ref = 4.0e6 / (float)(d_reference_divisor); // frequency steps
int divisor = int((target_lo_freq + (f_ref * 4)) / (f_ref * 8));
float actual_lo_freq = (f_ref * 8 * divisor);
@@ -218,7 +222,7 @@
if((divisor & ~0x7fff) != 0) { // must be 15-bits or less
return args;
}
-
+
// build i2c command string
std::vector<int> buf(4);
buf[0] = (divisor >> 8) & 0xff; // DB1
@@ -290,7 +294,6 @@
db_tv_rx::is_quadrature()
{
// Return True if this board requires both I & Q analog channels.
- //return false;
return false;
}
Modified:
gnuradio/branches/developers/trondeau/dbs/usrp/host/lib/legacy/db_tv_rx.h
===================================================================
--- gnuradio/branches/developers/trondeau/dbs/usrp/host/lib/legacy/db_tv_rx.h
2008-08-18 03:09:51 UTC (rev 9306)
+++ gnuradio/branches/developers/trondeau/dbs/usrp/host/lib/legacy/db_tv_rx.h
2008-08-18 03:14:16 UTC (rev 9307)
@@ -41,6 +41,7 @@
public:
db_tv_rx(usrp_basic *usrp, int which,
float first_IF, float second_IF);
+ ~db_tv_rx();
float gain_min();
float gain_max();
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r9307 - gnuradio/branches/developers/trondeau/dbs/usrp/host/lib/legacy,
trondeau <=