summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Demel <demel@ant.uni-bremen.de>2020-07-24 10:20:54 +0200
committerMartin Braun <martin@gnuradio.org>2020-07-30 10:08:47 -0700
commitf25a97122d74ce8217efcdec807b4c338627ec06 (patch)
treed9eb9528175bc94fe65b16e1262b667517788b72
parent30643f01609e915296023adc37123e27e2c86d3f (diff)
uhd: Update possible master_clock_rate:s
A USRP block offers the option to set a `clock_rate` which in turn sets `master_clock_rate` in UHD. There were some common options (153.6MHz, 125MHz, 122.88MHz) missing for N310s. Now these options are added. Instead of a separate call to `set_clock_rate`, `master_clock_rate` is now set as part of the device address string. This behavior makes it more consistent with UHD examples. Flowgraphs that set MCR as part of their `device_args` option, are currently overruled if clock rate is set too. This behavior may easily be reversed. According to the UHD manual, X300s don't support `set_master_clock_rate`, thus in this case it is strictly necessary to set MCR as part of the device address string.
-rw-r--r--gr-uhd/grc/gen_uhd_usrp_blocks.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/gr-uhd/grc/gen_uhd_usrp_blocks.py b/gr-uhd/grc/gen_uhd_usrp_blocks.py
index 6b9eb938b7..51aa22fc92 100644
--- a/gr-uhd/grc/gen_uhd_usrp_blocks.py
+++ b/gr-uhd/grc/gen_uhd_usrp_blocks.py
@@ -59,8 +59,8 @@ parameters:
label: Clock Rate (Hz)
dtype: real
default: 0e0
- options: [0e0, 200e6, 184.32e6, 120e6, 30.72e6]
- option_labels: [Default, 200 MHz, 184.32 MHz, 120 MHz, 30.72 MHz]
+ options: [0e0, 200e6, 184.32e6, 153.6e6, 125.0e6, 122.88e6, 120e6, 30.72e6]
+ option_labels: [Default, 200 MHz, 184.32 MHz, 153.6 MHz, 125 MHz, 122.88 MHz, 120 MHz, 30.72 MHz]
hide: ${'$'}{ 'none' if clock_rate else 'part' }
- id: num_mboards
label: Num Mboards
@@ -123,7 +123,11 @@ templates:
import time
make: |
uhd.usrp_${sourk}(
+ ${'%'} if clock_rate():
+ ",".join((${'$'}{dev_addr}, ${'$'}{dev_args}, "master_clock_rate=${'$'}{clock_rate}")),
+ ${'%'} else:
",".join((${'$'}{dev_addr}, ${'$'}{dev_args})),
+ ${'%'} endif
uhd.stream_args(
cpu_format="${'$'}{type}",
${'%'} if otw:
@@ -144,9 +148,6 @@ templates:
${'%'} endif
% endif
)
- ${'%'} if clock_rate():
- self.${'$'}{id}.set_clock_rate(${'$'}{clock_rate}, uhd.ALL_MBOARDS)
- ${'%'} endif
% for m in range(max_mboards):
${'%'} if context.get('num_mboards')() > ${m}: