diff options
author | Josh Blum | 2010-03-01 16:16:16 -0800 |
---|---|---|
committer | Josh Blum | 2010-03-01 16:16:16 -0800 |
commit | c85606eaaf5a73387d4423bdeb2f63483394137e (patch) | |
tree | 27acac1fe78a637b5d95f8b872f4366b1c12f03f /gr-uhd/lib/uhd_simple_source.cc | |
parent | 00f9ccaa50ed26d71a66d19f8f1518874004c5de (diff) | |
download | gnuradio-c85606eaaf5a73387d4423bdeb2f63483394137e.tar.gz gnuradio-c85606eaaf5a73387d4423bdeb2f63483394137e.tar.bz2 gnuradio-c85606eaaf5a73387d4423bdeb2f63483394137e.zip |
using samples prop, added unchecked in files for utils and grc rx wrapper
Diffstat (limited to 'gr-uhd/lib/uhd_simple_source.cc')
-rw-r--r-- | gr-uhd/lib/uhd_simple_source.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gr-uhd/lib/uhd_simple_source.cc b/gr-uhd/lib/uhd_simple_source.cc index 4bd3622f3..360b91434 100644 --- a/gr-uhd/lib/uhd_simple_source.cc +++ b/gr-uhd/lib/uhd_simple_source.cc @@ -92,10 +92,12 @@ int uhd_simple_source::work( gr_vector_void_star &output_items ){ + const size_t max_samples = wax::cast<size_t>((*_dev)[uhd::DEVICE_PROP_MAX_RX_SAMPLES]); + size_t total_items_read = 0; size_t count = 0; uhd::metadata_t metadata; - while(total_items_read == 0 or total_items_read + 1500/_sizeof_samp < size_t(noutput_items)){ + while(total_items_read == 0 or total_items_read + max_samples < size_t(noutput_items)){ size_t items_read = _dev->recv( boost::asio::buffer( (uint8_t *)output_items[0]+(total_items_read*_sizeof_samp), @@ -114,7 +116,7 @@ int uhd_simple_source::work( //the timeout part boost::this_thread::sleep(boost::posix_time::milliseconds(1)); - count++; if (count > 50) break; + if (++count > 50) break; } return total_items_read; |