diff options
author | Josh Blum <josh@joshknows.com> | 2010-03-04 18:34:28 -0800 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2010-03-04 18:34:28 -0800 |
commit | bb86022d5a5f7055cdeebaeb4a55216e1a056fd4 (patch) | |
tree | 8dd96e7b0fcef00fde57da97d44e012cc6177670 /host/lib/usrp/usrp2/io_impl.cpp | |
parent | 821c31417894bed5603dc1a18415d4a35ddd7c2d (diff) | |
download | uhd-bb86022d5a5f7055cdeebaeb4a55216e1a056fd4.tar.gz uhd-bb86022d5a5f7055cdeebaeb4a55216e1a056fd4.tar.bz2 uhd-bb86022d5a5f7055cdeebaeb4a55216e1a056fd4.zip |
Moved timeouts into the udp transports.
Simplified the fast path checking in the fw, but it turns out this was not the issue.
Fixed some bad bit operations with the 16sc words (dont forget sign extension).
Added some more documentation to the headers....
Diffstat (limited to 'host/lib/usrp/usrp2/io_impl.cpp')
-rw-r--r-- | host/lib/usrp/usrp2/io_impl.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/host/lib/usrp/usrp2/io_impl.cpp b/host/lib/usrp/usrp2/io_impl.cpp index 6273846dc..cc7746720 100644 --- a/host/lib/usrp/usrp2/io_impl.cpp +++ b/host/lib/usrp/usrp2/io_impl.cpp @@ -71,9 +71,9 @@ static inline void host_floats_to_usrp2_items( size_t num_samps ){ unrolled_loop(i, num_samps,{ - int16_t real = host_floats[i].real()*shorts_per_float; - int16_t imag = host_floats[i].imag()*shorts_per_float; - usrp2_items[i] = htonl(((real << 16) & 0xffff) | ((imag << 0) & 0xffff)); + uint16_t real = host_floats[i].real()*shorts_per_float; + uint16_t imag = host_floats[i].imag()*shorts_per_float; + usrp2_items[i] = htonl((real << 16) | (imag << 0)); }); } @@ -84,8 +84,8 @@ static inline void usrp2_items_to_host_floats( ){ unrolled_loop(i, num_samps,{ uint32_t item = ntohl(usrp2_items[i]); - int16_t real = (item >> 16) & 0xffff; - int16_t imag = (item >> 0) & 0xffff; + int16_t real = item >> 16; + int16_t imag = item >> 0; host_floats[i] = fc32_t(real*floats_per_short, imag*floats_per_short); }); } @@ -130,9 +130,7 @@ void usrp2_impl::recv_raw(rx_metadata_t &metadata){ return; //must exit here after setting the buffer } const uint32_t *vrt_hdr = asio::buffer_cast<const uint32_t *>(_rx_smart_buff->get()); - size_t num_header_words32_out; - size_t num_payload_words32_out; - size_t packet_count_out; + size_t num_header_words32_out, num_payload_words32_out, packet_count_out; try{ vrt::unpack( metadata, //output |