On Mon, Mar 16, 2009 at 7:43 AM, Mattias Kjellsson <[email protected]> wrote:
> If I install a signal handler which catches ctrl+c and sets a flag, and then
> use (still the same configuration) uses something like:
>
> top_block->start();
> while(!signaled)
> asm(" nop");
> top_block->stop();
>
> The flow- graph is run as long as ctrl+c isn't pressed and the destructor of
> top_block is run as well.
This is the right way. Unless you call top_block.run(), you are
responsible for your own SIGINT handler.
> Why is the destructor so important? It's important because if I don't add
> the two following statements in there:
>
> d_tx0->write_io (d_side, -129, 224);
> d_tx0->write_io (d_side, -129, 128);
> (where d_tx0 is a usrp_sink_s_sptr)
>
> I end up with a pike in the spectrum at the tuned center frequency.
This is an open bug (ticket #348), not your code. It's not clear yet
why it happens, but one theory is that we are shutting down the USRP
transmit pipeline before it has a chance to drain, and leaving a DC
value as input to the CORDIC, resulting in a carrier tone. Your
workaround is appropriate.
Johnathan
_______________________________________________
Discuss-gnuradio mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio