From e20160b7cc480176ba629ebfbe9fb073963c25d3 Mon Sep 17 00:00:00 2001 From: Johnathan Corgan Date: Sat, 19 Jun 2010 11:27:56 -0700 Subject: gr-usrp2: implement start_streaming_at(usrp2::fpga_timestamp time) This new method on usrp2.sink_* causes the first TX sample data to be sent at the FPGA clock time specified, with all further data immediately following. u = usrp2.sink_32fc() # or 16sc ...configure sink here... u.sync_to_pps() ...delay a second for PPS to have happened u.start_streaming_at(int(100e6)) # start TX stream one second later ...start flowgraph here... If this function is not called, all transmit data will be sent immediately (the prior behavior). --- gr-usrp2/src/usrp2_sink_16sc.cc | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'gr-usrp2/src/usrp2_sink_16sc.cc') diff --git a/gr-usrp2/src/usrp2_sink_16sc.cc b/gr-usrp2/src/usrp2_sink_16sc.cc index 1e7c54dcd..75cc1f4a6 100644 --- a/gr-usrp2/src/usrp2_sink_16sc.cc +++ b/gr-usrp2/src/usrp2_sink_16sc.cc @@ -67,12 +67,20 @@ usrp2_sink_16sc::work(int noutput_items, return 0; usrp2::tx_metadata metadata; - metadata.timestamp = -1; - metadata.send_now = 1; + + // Set TX metadata to either start time or now + if (d_should_wait == true) { + metadata.timestamp = d_tx_time; + metadata.send_now = 0; + d_should_wait = false; + } + else { + metadata.timestamp = -1; + metadata.send_now = 1; + } metadata.start_of_burst = 1; - bool ok = d_u2->tx_16sc(0, // FIXME: someday, streams will have channel numbers - in, noutput_items, &metadata); + bool ok = d_u2->tx_16sc(0, in, noutput_items, &metadata); if (!ok){ std::cerr << "usrp2_sink_16sc: tx_16sc failed" << std::endl; return -1; // say we're done -- cgit