diff options
author | Josh Blum <josh@joshknows.com> | 2010-07-09 23:24:41 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2010-07-09 23:24:41 -0700 |
commit | 5e7af879c890c1168ba957ca9158428eeb387c94 (patch) | |
tree | 8009e94fac39527217e9c571da12f87a687b9903 /host/lib/usrp/usrp2/io_impl.cpp | |
parent | 09af5cbf7e8518b5e664ecc5138e83a884de6eff (diff) | |
download | uhd-5e7af879c890c1168ba957ca9158428eeb387c94.tar.gz uhd-5e7af879c890c1168ba957ca9158428eeb387c94.tar.bz2 uhd-5e7af879c890c1168ba957ca9158428eeb387c94.zip |
usrp2: removed SX packet count stuff from vrt packet handler, moved to usrp2 io impl and replaced with Os
Diffstat (limited to 'host/lib/usrp/usrp2/io_impl.cpp')
-rw-r--r-- | host/lib/usrp/usrp2/io_impl.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/host/lib/usrp/usrp2/io_impl.cpp b/host/lib/usrp/usrp2/io_impl.cpp index 7e231095f..430f28390 100644 --- a/host/lib/usrp/usrp2/io_impl.cpp +++ b/host/lib/usrp/usrp2/io_impl.cpp @@ -83,6 +83,8 @@ void usrp2_impl::io_impl::recv_pirate_loop( ){ set_thread_priority_safe(); recv_pirate_crew_raiding = true; + size_t next_packet_seq = 0; + while(recv_pirate_crew_raiding){ managed_recv_buffer::sptr buff = zc_if->get_recv_buff(); if (not buff.get()) continue; //ignore timeout/error buffers @@ -93,13 +95,15 @@ void usrp2_impl::io_impl::recv_pirate_loop( if_packet_info.num_packet_words32 = buff->size()/sizeof(boost::uint32_t); vrt::if_hdr_unpack_be(buff->cast<const boost::uint32_t *>(), if_packet_info); + //handle the packet count / sequence number + if (if_packet_info.packet_count != next_packet_seq){ + //std::cerr << "S" << (if_packet_info.packet_count - next_packet_seq)%16; + std::cerr << "O"; //report overrun (drops in the kernel) + } + next_packet_seq = (if_packet_info.packet_count+1)%16; + //extract the timespec and round to the nearest packet UHD_ASSERT_THROW(if_packet_info.has_tsi and if_packet_info.has_tsf); - - //size_t pkt_dur_ticks = mboard->get_master_clock_freq() * 1; //TODO FIXME - //size_t(if_packet_info.tsf) - size_t(if_packet_info.tsf)%pkt_dur_ticks - //the idea is to round the time specs to packet boundaries to avoid the issue - //of never getting alignment when things are not locked properly time_spec_t time( time_t(if_packet_info.tsi), size_t(if_packet_info.tsf), mboard->get_master_clock_freq() ); |