Revision e692e713 gr-utils/src/python/usrp_test_counting.py
| b/gr-utils/src/python/usrp_test_counting.py | ||
|---|---|---|
| 1 | 1 |
#!/usr/bin/env python |
| 2 | 2 |
# |
| 3 |
# Copyright 2004 Free Software Foundation, Inc. |
|
| 3 |
# Copyright 2004,2007 Free Software Foundation, Inc.
|
|
| 4 | 4 |
# |
| 5 | 5 |
# This file is part of GNU Radio |
| 6 | 6 |
# |
| ... | ... | |
| 32 | 32 |
def build_graph (): |
| 33 | 33 |
rx_decim = 32 |
| 34 | 34 |
|
| 35 |
fg = gr.flow_graph ()
|
|
| 35 |
tb = gr.top_block ()
|
|
| 36 | 36 |
usrp_rx = usrp.source_s (0, rx_decim, 1, 0x32103210, usrp.FPGA_MODE_COUNTING) |
| 37 | 37 |
sink = gr.check_counting_s () |
| 38 |
fg.connect (usrp_rx, sink)
|
|
| 38 |
tb.connect (usrp_rx, sink)
|
|
| 39 | 39 |
|
| 40 | 40 |
# file_sink = gr.file_sink (gr.sizeof_short, 'counting.dat') |
| 41 |
# fg.connect (usrp_rx, file_sink)
|
|
| 41 |
# tb.connect (usrp_rx, file_sink)
|
|
| 42 | 42 |
|
| 43 |
return fg
|
|
| 43 |
return tb
|
|
| 44 | 44 |
|
| 45 | 45 |
def main (): |
| 46 |
fg = build_graph ()
|
|
| 46 |
tb = build_graph ()
|
|
| 47 | 47 |
try: |
| 48 |
fg.run()
|
|
| 48 |
tb.run()
|
|
| 49 | 49 |
except KeyboardInterrupt: |
| 50 | 50 |
pass |
| 51 | 51 |
|
Also available in: Unified diff