summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjcorgan2008-09-24 15:36:17 +0000
committerjcorgan2008-09-24 15:36:17 +0000
commit0a6b55e1d0ec6317a57568adb3f196851d080219 (patch)
treee914eda8f03bf758dcd2d6239441eba2ac4fa8d8
parenta28feaa487290195201ac6767b51a61b05066d40 (diff)
downloadgnuradio-0a6b55e1d0ec6317a57568adb3f196851d080219.tar.gz
gnuradio-0a6b55e1d0ec6317a57568adb3f196851d080219.tar.bz2
gnuradio-0a6b55e1d0ec6317a57568adb3f196851d080219.zip
Minor cleanup
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@9651 221aa14e-8319-0410-a670-987f0aec2ac5
-rw-r--r--gr-usrp2/src/rx_16sc_handler.cc3
-rw-r--r--gr-usrp2/src/rx_16sc_handler.h16
-rw-r--r--gr-usrp2/src/rx_32fc_handler.cc3
-rw-r--r--gr-usrp2/src/rx_32fc_handler.h16
-rw-r--r--gr-usrp2/src/usrp2.i2
-rw-r--r--gr-usrp2/src/usrp2_base.cc2
-rw-r--r--gr-usrp2/src/usrp2_sink_16sc.cc6
-rw-r--r--gr-usrp2/src/usrp2_sink_32fc.cc4
-rw-r--r--gr-usrp2/src/usrp2_sink_base.cc4
-rw-r--r--gr-usrp2/src/usrp2_source_16sc.cc5
-rw-r--r--gr-usrp2/src/usrp2_source_16sc.h4
-rw-r--r--gr-usrp2/src/usrp2_source_32fc.cc3
-rw-r--r--gr-usrp2/src/usrp2_source_base.cc2
13 files changed, 23 insertions, 47 deletions
diff --git a/gr-usrp2/src/rx_16sc_handler.cc b/gr-usrp2/src/rx_16sc_handler.cc
index a3ab2a2b2..7fb9ad06f 100644
--- a/gr-usrp2/src/rx_16sc_handler.cc
+++ b/gr-usrp2/src/rx_16sc_handler.cc
@@ -21,11 +21,12 @@
*/
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include <config.h>
#endif
#include <rx_16sc_handler.h>
rx_16sc_handler::~rx_16sc_handler()
{
+ // NOP
}
diff --git a/gr-usrp2/src/rx_16sc_handler.h b/gr-usrp2/src/rx_16sc_handler.h
index d9a9e72e4..9d5b1f2e9 100644
--- a/gr-usrp2/src/rx_16sc_handler.h
+++ b/gr-usrp2/src/rx_16sc_handler.h
@@ -26,8 +26,6 @@
#include <usrp2/rx_nop_handler.h>
#include <usrp2/copiers.h>
-#define RX_16SC_HANDLER_DEBUG 0
-
class rx_16sc_handler : public usrp2::rx_nop_handler
{
std::complex<int16_t> *d_dest;
@@ -43,30 +41,20 @@ public:
// Factory function to return a shared pointer to a new instance
static sptr make(uint64_t max_samples, uint64_t max_quantum, std::complex<int16_t> *dest)
{
- if (RX_16SC_HANDLER_DEBUG)
- printf("rx_16sc_handler: max_samples=%li max_quantum=%li\n", max_samples, max_quantum);
-
return sptr(new rx_16sc_handler(max_samples, max_quantum, dest));
}
// Invoked by USRP2 API when samples are available
bool operator()(const uint32_t *items, size_t nitems, const usrp2::rx_metadata *metadata)
{
- if (RX_16SC_HANDLER_DEBUG)
- printf("rx_16sc_handler: called with items=%zu ", nitems);
-
// Copy/reformat/endian swap USRP2 data to destination buffer
usrp2::copy_u2_16sc_to_host_16sc(nitems, items, d_dest);
d_dest += nitems;
// FIXME: do something with metadata
- // Determine if there is room to be called again
- bool ok = rx_nop_handler::operator()(items, nitems, metadata);
- if (RX_16SC_HANDLER_DEBUG)
- printf("ok to call again=%i\n", ok);
-
- return ok;
+ // Call parent to determine if there is room to be called again
+ return rx_nop_handler::operator()(items, nitems, metadata);
}
~rx_16sc_handler();
diff --git a/gr-usrp2/src/rx_32fc_handler.cc b/gr-usrp2/src/rx_32fc_handler.cc
index f8347633b..c9c251558 100644
--- a/gr-usrp2/src/rx_32fc_handler.cc
+++ b/gr-usrp2/src/rx_32fc_handler.cc
@@ -21,11 +21,12 @@
*/
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include <config.h>
#endif
#include <rx_32fc_handler.h>
rx_32fc_handler::~rx_32fc_handler()
{
+ // NOP
}
diff --git a/gr-usrp2/src/rx_32fc_handler.h b/gr-usrp2/src/rx_32fc_handler.h
index 028dfadab..f2ce2b55d 100644
--- a/gr-usrp2/src/rx_32fc_handler.h
+++ b/gr-usrp2/src/rx_32fc_handler.h
@@ -27,8 +27,6 @@
#include <usrp2/copiers.h>
#include <gr_complex.h>
-#define RX_32FC_HANDLER_DEBUG 0
-
class rx_32fc_handler : public usrp2::rx_nop_handler
{
gr_complex *d_dest;
@@ -44,30 +42,20 @@ public:
// Factory function to return a shared pointer to a new instance
static sptr make(uint64_t max_samples, uint64_t max_quantum, gr_complex *dest)
{
- if (RX_32FC_HANDLER_DEBUG)
- printf("rx_32fc_handler: max_samples=%li max_quantum=%li\n", max_samples, max_quantum);
-
return sptr(new rx_32fc_handler(max_samples, max_quantum, dest));
}
// Invoked by USRP2 API when samples are available
bool operator()(const uint32_t *items, size_t nitems, const usrp2::rx_metadata *metadata)
{
- if (RX_32FC_HANDLER_DEBUG)
- printf("rx_32fc_handler: called with items=%zu ", nitems);
-
// Copy/reformat/endian swap USRP2 data to destination buffer
usrp2::copy_u2_16sc_to_host_32fc(nitems, items, d_dest);
d_dest += nitems;
// FIXME: do something with metadata
- // Determine if there is room to be called again
- bool ok = rx_nop_handler::operator()(items, nitems, metadata);
- if (RX_32FC_HANDLER_DEBUG)
- printf("ok to call again=%i\n", ok);
-
- return ok;
+ // Call parent to determine if there is room to be called again
+ return rx_nop_handler::operator()(items, nitems, metadata);
}
~rx_32fc_handler();
diff --git a/gr-usrp2/src/usrp2.i b/gr-usrp2/src/usrp2.i
index ae13ab25b..9f82c4cde 100644
--- a/gr-usrp2/src/usrp2.i
+++ b/gr-usrp2/src/usrp2.i
@@ -98,8 +98,6 @@ protected:
public:
~usrp2_source_16sc();
-
- std::string mac_addr();
};
// ----------------------------------------------------------------
diff --git a/gr-usrp2/src/usrp2_base.cc b/gr-usrp2/src/usrp2_base.cc
index 19b977edb..4103862cb 100644
--- a/gr-usrp2/src/usrp2_base.cc
+++ b/gr-usrp2/src/usrp2_base.cc
@@ -21,7 +21,7 @@
*/
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include <config.h>
#endif
#include <usrp2_base.h>
diff --git a/gr-usrp2/src/usrp2_sink_16sc.cc b/gr-usrp2/src/usrp2_sink_16sc.cc
index f1356bb42..9b3977b30 100644
--- a/gr-usrp2/src/usrp2_sink_16sc.cc
+++ b/gr-usrp2/src/usrp2_sink_16sc.cc
@@ -21,7 +21,7 @@
*/
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include <config.h>
#endif
#include <usrp2_sink_16sc.h>
@@ -62,10 +62,10 @@ usrp2_sink_16sc::work(int noutput_items,
metadata.send_now = 1;
metadata.start_of_burst = 1;
- bool ok = d_u2->tx_16sc(0, // FIXME: someday, streams will have channel numbers
+ bool ok = d_u2->tx_16sc(0, // FIXME: use channel number instead of 0
in, noutput_items, &metadata);
if (!ok){
- std::cerr << "usrp2_sink_16sc: tx_complex_int16 failed" << std::endl;
+ std::cerr << "usrp2_sink_16sc: tx_16sc failed" << std::endl;
return -1; // say we're done
}
diff --git a/gr-usrp2/src/usrp2_sink_32fc.cc b/gr-usrp2/src/usrp2_sink_32fc.cc
index f630c964b..a36d991e0 100644
--- a/gr-usrp2/src/usrp2_sink_32fc.cc
+++ b/gr-usrp2/src/usrp2_sink_32fc.cc
@@ -21,7 +21,7 @@
*/
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include <config.h>
#endif
#include <usrp2_sink_32fc.h>
@@ -62,7 +62,7 @@ usrp2_sink_32fc::work(int noutput_items,
metadata.send_now = 1;
metadata.start_of_burst = 1;
- bool ok = d_u2->tx_32fc(0, // FIXME: someday, streams will have channel numbers
+ bool ok = d_u2->tx_32fc(0, // FIXME: use channel number instead of 0
in, noutput_items, &metadata);
if (!ok){
std::cerr << "usrp2_sink_32fc: tx_32fc failed" << std::endl;
diff --git a/gr-usrp2/src/usrp2_sink_base.cc b/gr-usrp2/src/usrp2_sink_base.cc
index 8a622d65f..0034dd4e9 100644
--- a/gr-usrp2/src/usrp2_sink_base.cc
+++ b/gr-usrp2/src/usrp2_sink_base.cc
@@ -21,15 +21,13 @@
*/
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include <config.h>
#endif
#include <usrp2_sink_base.h>
#include <gr_io_signature.h>
#include <iostream>
-#define USRP2_SINK_BASE_DEBUG 0
-
usrp2_sink_base::usrp2_sink_base(const char *name,
gr_io_signature_sptr input_signature,
const std::string &ifc,
diff --git a/gr-usrp2/src/usrp2_source_16sc.cc b/gr-usrp2/src/usrp2_source_16sc.cc
index 1ff32a56e..96dd628b9 100644
--- a/gr-usrp2/src/usrp2_source_16sc.cc
+++ b/gr-usrp2/src/usrp2_source_16sc.cc
@@ -21,7 +21,7 @@
*/
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include <config.h>
#endif
#include <usrp2_source_16sc.h>
@@ -47,6 +47,7 @@ usrp2_source_16sc::usrp2_source_16sc(const std::string &ifc, const std::string &
usrp2_source_16sc::~usrp2_source_16sc()
{
+ // NOP
}
int
@@ -58,7 +59,7 @@ usrp2_source_16sc::work(int noutput_items,
rx_16sc_handler::sptr handler = rx_16sc_handler::make(noutput_items, USRP2_MIN_RX_SAMPLES, out);
- bool ok = d_u2->rx_samples(0, handler.get());
+ bool ok = d_u2->rx_samples(0, handler.get()); // FIXME: channel number instead of 0
if (!ok){
std::cerr << "usrp2::rx_samples() failed" << std::endl;
return -1; // say we're done
diff --git a/gr-usrp2/src/usrp2_source_16sc.h b/gr-usrp2/src/usrp2_source_16sc.h
index 7a6b8e596..4ab9648b0 100644
--- a/gr-usrp2/src/usrp2_source_16sc.h
+++ b/gr-usrp2/src/usrp2_source_16sc.h
@@ -20,8 +20,8 @@
* Boston, MA 02110-1301, USA.
*/
-#ifndef INCLUDED_USRP2_SOURCE_C_H
-#define INCLUDED_USRP2_SOURCE_C_H
+#ifndef INCLUDED_USRP2_SOURCE_16SC_H
+#define INCLUDED_USRP2_SOURCE_16SC_H
#include <usrp2_source_base.h>
diff --git a/gr-usrp2/src/usrp2_source_32fc.cc b/gr-usrp2/src/usrp2_source_32fc.cc
index 5726f2279..f5a3c2f1e 100644
--- a/gr-usrp2/src/usrp2_source_32fc.cc
+++ b/gr-usrp2/src/usrp2_source_32fc.cc
@@ -47,6 +47,7 @@ usrp2_source_32fc::usrp2_source_32fc(const std::string &ifc, const std::string &
usrp2_source_32fc::~usrp2_source_32fc()
{
+ // NOP
}
int
@@ -58,7 +59,7 @@ usrp2_source_32fc::work(int noutput_items,
rx_32fc_handler::sptr handler = rx_32fc_handler::make(noutput_items, USRP2_MIN_RX_SAMPLES, out);
- bool ok = d_u2->rx_samples(0, handler.get());
+ bool ok = d_u2->rx_samples(0, handler.get()); // FIXME: channel number instead of 0
if (!ok){
std::cerr << "usrp2::rx_samples() failed" << std::endl;
return -1; // say we're done
diff --git a/gr-usrp2/src/usrp2_source_base.cc b/gr-usrp2/src/usrp2_source_base.cc
index e83014308..0f174bf20 100644
--- a/gr-usrp2/src/usrp2_source_base.cc
+++ b/gr-usrp2/src/usrp2_source_base.cc
@@ -21,7 +21,7 @@
*/
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include <config.h>
#endif
#include <usrp2_source_base.h>