[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r9303 - gnuradio/branches/developers/trondeau/dbs/gr-u
From: |
trondeau |
Subject: |
[Commit-gnuradio] r9303 - gnuradio/branches/developers/trondeau/dbs/gr-usrp/src |
Date: |
Sun, 17 Aug 2008 20:59:27 -0600 (MDT) |
Author: trondeau
Date: 2008-08-17 20:59:26 -0600 (Sun, 17 Aug 2008)
New Revision: 9303
Modified:
gnuradio/branches/developers/trondeau/dbs/gr-usrp/src/usrp1_base.cc
gnuradio/branches/developers/trondeau/dbs/gr-usrp/src/usrp1_base.h
gnuradio/branches/developers/trondeau/dbs/gr-usrp/src/usrp1_base.i
gnuradio/branches/developers/trondeau/dbs/gr-usrp/src/usrp1_source.i
gnuradio/branches/developers/trondeau/dbs/gr-usrp/src/usrp1_source_base.cc
gnuradio/branches/developers/trondeau/dbs/gr-usrp/src/usrp1_source_base.h
Log:
fixing mux value usage. No need to convert to hex for C++ since we're all in C++
Modified: gnuradio/branches/developers/trondeau/dbs/gr-usrp/src/usrp1_base.cc
===================================================================
--- gnuradio/branches/developers/trondeau/dbs/gr-usrp/src/usrp1_base.cc
2008-08-17 23:04:34 UTC (rev 9302)
+++ gnuradio/branches/developers/trondeau/dbs/gr-usrp/src/usrp1_base.cc
2008-08-18 02:59:26 UTC (rev 9303)
@@ -59,6 +59,7 @@
usrp1_base::~usrp1_base ()
{
+ delete d_usrp;
}
int
@@ -89,22 +90,6 @@
}
}
-int hexint(unsigned int mask)
-{
- /*
- Convert unsigned masks into signed ints.
-
- This allows us to use hex constants like 0xf0f0f0f2 when talking to
- our hardware and not get screwed by them getting treated as python
- longs.
- */
-
- if(mask >= (unsigned int)pow(2, 31)) {
- return int(mask - (unsigned int)pow(2, 32));
- }
- return mask;
-}
-
#if 0
int
usrp1_base::determine_rx_mux_value(const std::vector<int> &subdev_spec)
Modified: gnuradio/branches/developers/trondeau/dbs/gr-usrp/src/usrp1_base.h
===================================================================
--- gnuradio/branches/developers/trondeau/dbs/gr-usrp/src/usrp1_base.h
2008-08-17 23:04:34 UTC (rev 9302)
+++ gnuradio/branches/developers/trondeau/dbs/gr-usrp/src/usrp1_base.h
2008-08-18 02:59:26 UTC (rev 9303)
@@ -51,8 +51,6 @@
unsigned int d_mux_val;
};
-int hexint(unsigned int mask);
-
/*!
* \brief abstract interface to Universal Software Radio Peripheral (Rev 1)
*/
@@ -76,9 +74,9 @@
virtual std::vector<db_base_sptr> db(int which)
{ throw std::runtime_error("db called from base class\n"); }
- virtual int determine_tx_mux_value(const std::vector<int> &subdev_spec)
+ virtual unsigned int determine_tx_mux_value(const std::vector<int>
&subdev_spec)
{ throw std::runtime_error("determing_tx_value called from base class\n"); }
- virtual int determine_rx_mux_value(const std::vector<int> &subdev_spec)
+ virtual unsigned int determine_rx_mux_value(const std::vector<int>
&subdev_spec)
{ throw std::runtime_error("determing_rx_value called from base class\n"); }
virtual db_base_sptr selected_subdev(const std::vector<int> &subdev_spec)
{ throw std::runtime_error("selected_subdev called from base class\n"); }
@@ -86,8 +84,8 @@
virtual bool start() {return false;}
virtual bool stop() {return false;}
- virtual bool set_nchannels (int nchan) {return false;}
- virtual bool set_mux (int mux) {return false;}
+ virtual bool set_nchannels (unsigned int nchan) {return false;}
+ virtual bool set_mux (unsigned int mux) {return false;}
virtual void set_verbose (bool verbose) {}
Modified: gnuradio/branches/developers/trondeau/dbs/gr-usrp/src/usrp1_base.i
===================================================================
--- gnuradio/branches/developers/trondeau/dbs/gr-usrp/src/usrp1_base.i
2008-08-17 23:04:34 UTC (rev 9302)
+++ gnuradio/branches/developers/trondeau/dbs/gr-usrp/src/usrp1_base.i
2008-08-18 02:59:26 UTC (rev 9303)
@@ -55,8 +55,8 @@
virtual bool start() {return false;}
virtual bool stop() {return false;}
- virtual bool set_nchannels (int nchan) {return false;}
- virtual bool set_mux (int mux) {return false;}
+ virtual bool set_nchannels (unsigned int nchan) {return false;}
+ virtual bool set_mux (unsigned int mux) {return false;}
virtual void set_verbose (bool verbose) {}
Modified: gnuradio/branches/developers/trondeau/dbs/gr-usrp/src/usrp1_source.i
===================================================================
--- gnuradio/branches/developers/trondeau/dbs/gr-usrp/src/usrp1_source.i
2008-08-17 23:04:34 UTC (rev 9302)
+++ gnuradio/branches/developers/trondeau/dbs/gr-usrp/src/usrp1_source.i
2008-08-18 02:59:26 UTC (rev 9303)
@@ -60,8 +60,7 @@
public:
~usrp1_source_base ();
- int determine_tx_mux_value(const std::vector<int> &subdev_spec);
- int determine_rx_mux_value(const std::vector<int> &subdev_spec);
+ unsigned int determine_rx_mux_value(const std::vector<int> &subdev_spec);
db_base_sptr selected_subdev(const std::vector<int> &subdev_spec);
int work (int noutput_items,
@@ -72,8 +71,8 @@
bool stop();
bool set_decim_rate (unsigned int rate);
- bool set_nchannels (int nchan);
- bool set_mux (int mux);
+ bool set_nchannels (unsigned int nchan);
+ bool set_mux (unsigned int mux);
bool set_rx_freq (int channel, double freq);
bool set_fpga_mode (int mode);
void set_verbose (bool verbose);
Modified:
gnuradio/branches/developers/trondeau/dbs/gr-usrp/src/usrp1_source_base.cc
===================================================================
--- gnuradio/branches/developers/trondeau/dbs/gr-usrp/src/usrp1_source_base.cc
2008-08-17 23:04:34 UTC (rev 9302)
+++ gnuradio/branches/developers/trondeau/dbs/gr-usrp/src/usrp1_source_base.cc
2008-08-18 02:59:26 UTC (rev 9303)
@@ -62,10 +62,9 @@
usrp1_source_base::~usrp1_source_base ()
{
- //delete d_usrp;
}
-int
+unsigned int
usrp1_source_base::determine_rx_mux_value(const std::vector<int> &subdev_spec)
{
/*
@@ -97,8 +96,7 @@
int spec = subdev_spec[1];
if(!((side == 0 || side == 1))) {
- throw "Invalid subdev_spec";
- //raise ValueError, "Invalid subdev_spec: %r:" % (subdev_spec,)
+ throw std::runtime_error("Invalid subdev_spec\n");
}
// This is a tuple of length 1 or 2 containing the subdevice
@@ -116,7 +114,7 @@
subdev0_uses = 0x1; // uses A/D 0 only
}
- if(&db[1] != NULL) { // test if we have 2 daughterboards
+ if(db.size() > 1) { // test if we have 2 daughterboards
subdev1_uses = 0x2; // uses A/D 1 only
}
else {
@@ -131,12 +129,10 @@
}
else {
throw std::runtime_error("Invalid subdev_spec");
- //raise ValueError, "Invalid subdev_spec: %r: " % (subdev_spec,);
}
if(uses == 0) {
throw std::runtime_error("Daughterboard doesn't have a subdevice 1");
- //raise RuntimeError, "Daughterboard doesn't have a subdevice 1: %r: " %
(subdev_spec,);
}
bool swap_iq = db[0]->i_and_q_swapped();
@@ -159,7 +155,7 @@
while((i < 8) && (truth_table[i] != match))
i++;
- return hexint(truth_table[i].mux_val());
+ return truth_table[i].mux_val();
}
db_base_sptr
@@ -252,13 +248,13 @@
}
bool
-usrp1_source_base::set_nchannels (int nchan)
+usrp1_source_base::set_nchannels (unsigned int nchan)
{
return d_usrp->set_nchannels (nchan);
}
bool
-usrp1_source_base::set_mux (int mux)
+usrp1_source_base::set_mux (unsigned int mux)
{
return d_usrp->set_mux (mux);
}
Modified:
gnuradio/branches/developers/trondeau/dbs/gr-usrp/src/usrp1_source_base.h
===================================================================
--- gnuradio/branches/developers/trondeau/dbs/gr-usrp/src/usrp1_source_base.h
2008-08-17 23:04:34 UTC (rev 9302)
+++ gnuradio/branches/developers/trondeau/dbs/gr-usrp/src/usrp1_source_base.h
2008-08-18 02:59:26 UTC (rev 9303)
@@ -92,8 +92,7 @@
std::vector<db_base_sptr> db(int which) { return d_usrp->db(which); }
- //std::vector<db_base_sptr> db(int which);
- int determine_rx_mux_value(const std::vector<int> &subdev_spec);
+ unsigned int determine_rx_mux_value(const std::vector<int> &subdev_spec);
db_base_sptr selected_subdev(const std::vector<int> &subdev_spec);
int work (int noutput_items,
@@ -110,8 +109,8 @@
* adc_freq () / decim_rate ()
*/
bool set_decim_rate (unsigned int rate);
- bool set_nchannels (int nchan);
- bool set_mux (int mux);
+ bool set_nchannels (unsigned int nchan);
+ bool set_mux (unsigned int mux);
/*!
* \brief set the center frequency of the digital down converter.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r9303 - gnuradio/branches/developers/trondeau/dbs/gr-usrp/src,
trondeau <=