aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bladerf/bladerf_common.cc
diff options
context:
space:
mode:
authorJon Szymaniak <jon.szymaniak@gmail.com>2013-10-25 23:40:05 -0400
committerDimitri Stolnikov <horiz0n@gmx.net>2013-10-30 18:59:48 +0100
commit03c42ef3206f5667459f78781f95d7fc5c322053 (patch)
treed2d0c7fde68cedd99135243809493e5aa4859492 /lib/bladerf/bladerf_common.cc
parent46a241624a328e7107268a0c48a7bc364e4b523e (diff)
bladerf: Moved no longer "common" items out of bladerf_common
The gr_complex FIFO is no longer used on the TX side, so it doesn't really make sense to have it in bladerf_common. The associated items have been moved into bladerf_source, and some renaming has been done in bladerf_sink to tidy up. Pending further performance tests of the bladerf_source, the _fifo member (boost::circular_buffer) may need to be replaced.
Diffstat (limited to 'lib/bladerf/bladerf_common.cc')
-rw-r--r--lib/bladerf/bladerf_common.cc40
1 files changed, 2 insertions, 38 deletions
diff --git a/lib/bladerf/bladerf_common.cc b/lib/bladerf/bladerf_common.cc
index 4f919a1..fb49158 100644
--- a/lib/bladerf/bladerf_common.cc
+++ b/lib/bladerf/bladerf_common.cc
@@ -40,49 +40,13 @@
#include "bladerf_common.h"
-#define BLADERF_FIFO_SIZE_ENV "BLADERF_SAMPLE_FIFO_SIZE"
-
using namespace boost::assign;
boost::mutex bladerf_common::_devs_mutex;
std::list<boost::weak_ptr<struct bladerf> > bladerf_common::_devs;
-bladerf_common::bladerf_common() :
- _is_running(false)
-{
- const char *env_fifo_size;
- size_t fifo_size;
-
- env_fifo_size = getenv(BLADERF_FIFO_SIZE_ENV);
- fifo_size = BLADERF_SAMPLE_FIFO_SIZE;
-
- if (env_fifo_size != NULL) {
- try {
- fifo_size = boost::lexical_cast<size_t>(env_fifo_size);
- } catch (const boost::bad_lexical_cast &e) {
- std::cerr << "Warning: \"" << BLADERF_FIFO_SIZE_ENV
- << "\" is invalid" << "... defaulting to "
- << fifo_size;
- }
-
- if (fifo_size < BLADERF_SAMPLE_FIFO_MIN_SIZE) {
- fifo_size = BLADERF_SAMPLE_FIFO_MIN_SIZE;
- std::cerr << "Warning: \"" << BLADERF_FIFO_SIZE_ENV
- << "\" is too small" << "... defaulting to "
- << BLADERF_SAMPLE_FIFO_MIN_SIZE;
- }
- }
-
- _fifo = new boost::circular_buffer<gr_complex>(fifo_size);
- if (!_fifo)
- throw std::runtime_error( std::string(__FUNCTION__) +
- " has failed to allocate a sample FIFO!" );
-}
-
-bladerf_common::~bladerf_common()
-{
- delete _fifo;
-}
+bladerf_common::bladerf_common() : _is_running(false) {}
+bladerf_common::~bladerf_common() {}
bladerf_sptr bladerf_common:: get_cached_device(struct bladerf_devinfo devinfo)
{