diff options
author | Josh Blum <josh@joshknows.com> | 2010-07-04 19:13:59 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2010-07-05 13:49:03 -0700 |
commit | 5e14653f241070791d46893e68e341357e040add (patch) | |
tree | 1b4e8da3e0fa3f2a53dd309d9f9ffddfd5c6f953 /host/lib/transport | |
parent | 11f2aa1ea0fd6c28a20c6d85f94e41a06b3a6770 (diff) | |
download | uhd-5e14653f241070791d46893e68e341357e040add.tar.gz uhd-5e14653f241070791d46893e68e341357e040add.tar.bz2 uhd-5e14653f241070791d46893e68e341357e040add.zip |
usrp2: bug fix for readback registers
added readback for time64
fixed bug for fragment flag in vrt packet handler
Diffstat (limited to 'host/lib/transport')
-rw-r--r-- | host/lib/transport/vrt_packet_handler.hpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/host/lib/transport/vrt_packet_handler.hpp b/host/lib/transport/vrt_packet_handler.hpp index 42cbb7e5a..177239509 100644 --- a/host/lib/transport/vrt_packet_handler.hpp +++ b/host/lib/transport/vrt_packet_handler.hpp @@ -151,20 +151,15 @@ namespace vrt_packet_handler{ //extract the number of samples available to copy size_t bytes_per_item = otw_type.get_sample_size(); size_t bytes_available = state.size_of_copy_buffs; - size_t num_samps = std::min(total_samps, bytes_available/bytes_per_item); - size_t bytes_to_copy = num_samps*bytes_per_item; - - //setup the fragment flags and offset - metadata.more_fragments = total_samps < num_samps; - metadata.fragment_offset = state.fragment_offset_in_samps; - state.fragment_offset_in_samps += num_samps; //set for next call + size_t nsamps_to_copy = std::min(total_samps, bytes_available/bytes_per_item); + size_t bytes_to_copy = nsamps_to_copy*bytes_per_item; for (size_t i = 0; i < state.width; i++){ //copy-convert the samples from the recv buffer uhd::transport::convert_otw_type_to_io_type( state.copy_buffs[i], otw_type, reinterpret_cast<boost::uint8_t *>(buffs[i]) + offset_bytes, - io_type, num_samps + io_type, nsamps_to_copy ); //update the rx copy buffer to reflect the bytes copied @@ -173,7 +168,12 @@ namespace vrt_packet_handler{ //update the copy buffer's availability state.size_of_copy_buffs -= bytes_to_copy; - return num_samps; + //setup the fragment flags and offset + metadata.more_fragments = state.size_of_copy_buffs != 0; + metadata.fragment_offset = state.fragment_offset_in_samps; + state.fragment_offset_in_samps += nsamps_to_copy; //set for next call + + return nsamps_to_copy; } /******************************************************************* |