summaryrefslogtreecommitdiff
path: root/gr-uhd
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2018-12-15 18:25:07 -0800
committerMartin Braun <martin.braun@ettus.com>2018-12-16 10:58:57 -0800
commit84252e3e09b50165bd8ebd8419d1d19e7fc51dd4 (patch)
treea875d31f18f37b935a45141fd194e85256c729c6 /gr-uhd
parent0a51da2ae0c9de3942e8a114ad2df388dba720ce (diff)
uhd: More fixes to GRC bindings (time/clock source, etc.)
- Subdev spec wasn't being applied at all - time/clock source, neither - Sync wouldn't stay the same value when it was set to "don't sync" - Bandwidth is no longer set when the value is 0, allowing for a default behaviour - OTW format wasn't being applied properly
Diffstat (limited to 'gr-uhd')
-rw-r--r--gr-uhd/grc/gen_uhd_usrp_blocks.py23
1 files changed, 20 insertions, 3 deletions
diff --git a/gr-uhd/grc/gen_uhd_usrp_blocks.py b/gr-uhd/grc/gen_uhd_usrp_blocks.py
index 9af9777bb7..c680098812 100644
--- a/gr-uhd/grc/gen_uhd_usrp_blocks.py
+++ b/gr-uhd/grc/gen_uhd_usrp_blocks.py
@@ -64,8 +64,8 @@ parameters:
- id: sync
label: Sync
dtype: enum
- options: [sync, pc_clock, '']
- option_labels: [unknown PPS, PC Clock, don't sync]
+ options: [sync, pc_clock, none]
+ option_labels: [Unknown PPS, PC Clock, No Sync]
hide: ${'$'}{ 'none' if sync else 'part'}
- id: clock_rate
label: Clock Rate (Hz)
@@ -140,7 +140,7 @@ templates:
uhd.stream_args(
cpu_format="${'$'}{type}",
${'%'} if otw:
- otw_format=${'$'}{otw},
+ otw_format="${'$'}{otw}",
${'%'} endif
${'%'} if stream_args:
args=${'$'}{stream_args},
@@ -155,6 +155,19 @@ templates:
${'$'}{len_tag_name},
${'%'} endif
)
+ % for m in range(max_mboards):
+ ${'%'} if context.get('num_mboards')() > ${m}:
+ ${'%'} if context.get('sd_spec${m}')():
+ self.${'$'}{id}.set_subdev_spec(${'$'}{${'sd_spec' + str(m)}}, ${m})
+ ${'%'} endif
+ ${'%'} if context.get('time_source${m}')():
+ self.${'$'}{id}.set_time_source(${'$'}{${'time_source' + str(m)}}, ${m})
+ ${'%'} endif
+ ${'%'} if context.get('clock_source${m}')():
+ self.${'$'}{id}.set_clock_source(${'$'}{${'clock_source' + str(m)}}, ${m})
+ ${'%'} endif
+ ${'%'} endif
+ % endfor
% for n in range(max_nchan):
${'%'} if context.get('nchan')() > ${n}:
self.${'$'}{id}.set_center_freq(${'$'}{${'center_freq' + str(n)}}, ${n})
@@ -164,7 +177,9 @@ templates:
self.${'$'}{id}.set_gain(${'$'}{${'gain' + str(n)}}, ${n})
${'%'} endif
self.${'$'}{id}.set_antenna(${'$'}{${'ant' + str(n)}}, ${n})
+ ${'%'} if context.get('bw${n}')():
self.${'$'}{id}.set_bandwidth(${'$'}{${'bw' + str(n)}}, ${n})
+ ${'%'} endif
${'%'} if context.get('show_lo_controls')():
self.${'$'}{id}.set_lo_source(${'$'}{${'lo_source' + str(n)}}, uhd.ALL_LOS, ${n})
self.${'$'}{id}.set_lo_export_enabled(${'$'}{${'lo_export' + str(n)}}, uhd.ALL_LOS, ${n})
@@ -179,6 +194,8 @@ templates:
self.${'$'}{id}.set_time_unknown_pps(uhd.time_spec())
${'%'} elif sync == 'pc_clock':
self.${'$'}{id}.set_time_now(uhd.time_spec(time.time()), uhd.ALL_MBOARDS)
+ ${'%'} else:
+ # No synchronization enforced.
${'%'} endif
callbacks:
- set_samp_rate(${'$'}{samp_rate})