summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gr-blocks/lib/min_XX_impl.cc.t4
-rw-r--r--gr-uhd/apps/uhd_app.py22
-rwxr-xr-xgr-uhd/apps/uhd_rx_cfile11
3 files changed, 26 insertions, 11 deletions
diff --git a/gr-blocks/lib/min_XX_impl.cc.t b/gr-blocks/lib/min_XX_impl.cc.t
index d1cea61424..0f7059f7cd 100644
--- a/gr-blocks/lib/min_XX_impl.cc.t
+++ b/gr-blocks/lib/min_XX_impl.cc.t
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2014,2015 Free Software Foundation, Inc.
+ * Copyright 2014,2015,2016 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -77,7 +77,7 @@ namespace gr {
}
else // vector mode output
- for(int i = 0; i < noutput_items * d_vlen_out; i++) {
+ for(size_t i = 0; i < noutput_items * d_vlen_out; i++) {
@I_TYPE@ min = ((@I_TYPE@ *)input_items[0])[i];
for(int k = 1; k < ninputs; k++) {
diff --git a/gr-uhd/apps/uhd_app.py b/gr-uhd/apps/uhd_app.py
index 0a2beec21c..ff4412a140 100644
--- a/gr-uhd/apps/uhd_app.py
+++ b/gr-uhd/apps/uhd_app.py
@@ -170,12 +170,17 @@ class UHDApp(object):
treq = uhd.tune_request(args.freq)
self.has_lo_sensor = 'lo_locked' in self.usrp.get_sensor_names()
# Make sure tuning is synched:
+ command_time_set = False
if len(self.channels) > 1:
if args.sync == 'pps':
self.usrp.set_time_unknown_pps(uhd.time_spec())
cmd_time = self.usrp.get_time_now() + uhd.time_spec(COMMAND_DELAY)
- for mb_idx in xrange(self.usrp.get_num_mboards()):
- self.usrp.set_command_time(cmd_time, mb_idx)
+ try:
+ for mb_idx in xrange(self.usrp.get_num_mboards()):
+ self.usrp.set_command_time(cmd_time, mb_idx)
+ command_time_set = True
+ except RuntimeError:
+ sys.stderr.write('[{prefix}] [WARNING] Failed to set command times.\n'.format(prefix=self.prefix))
for chan in self.channels:
self.tr = self.usrp.set_center_freq(treq, chan)
if self.tr == None:
@@ -183,7 +188,7 @@ class UHDApp(object):
prefix=self.prefix, chan=chan
))
exit(1)
- if len(self.channels) > 1:
+ if command_time_set:
for mb_idx in xrange(self.usrp.get_num_mboards()):
self.usrp.clear_command_time(mb_idx)
self.vprint("Syncing channels...".format(prefix=self.prefix))
@@ -226,10 +231,15 @@ class UHDApp(object):
else:
treq = uhd.tune_request(freq)
# Make sure tuning is synched:
+ command_time_set = False
if len(self.channels) > 1 and not skip_sync:
cmd_time = self.usrp.get_time_now() + uhd.time_spec(COMMAND_DELAY)
- for mb_idx in xrange(self.usrp.get_num_mboards()):
- self.usrp.set_command_time(cmd_time, mb_idx)
+ try:
+ for mb_idx in xrange(self.usrp.get_num_mboards()):
+ self.usrp.set_command_time(cmd_time, mb_idx)
+ command_time_set = True
+ except RuntimeError:
+ sys.stderr.write('[{prefix}] [WARNING] Failed to set command times.\n'.format(prefix=self.prefix))
for chan in self.channels:
self.tr = self.usrp.set_center_freq(treq, chan)
if self.tr == None:
@@ -237,7 +247,7 @@ class UHDApp(object):
prefix=self.prefix, chan=chan
))
exit(1)
- if len(self.channels) > 1 and not skip_sync:
+ if command_time_set:
for mb_idx in xrange(self.usrp.get_num_mboards()):
self.usrp.clear_command_time(mb_idx)
self.vprint("Syncing channels...".format(prefix=self.prefix))
diff --git a/gr-uhd/apps/uhd_rx_cfile b/gr-uhd/apps/uhd_rx_cfile
index 80bbc8766c..672e9641e4 100755
--- a/gr-uhd/apps/uhd_rx_cfile
+++ b/gr-uhd/apps/uhd_rx_cfile
@@ -115,18 +115,23 @@ class rx_cfile_block(gr.top_block):
else:
treq = uhd.tune_request(options.freq)
# Make sure tuning is synched:
+ command_time_set = False
if len(self.channels) > 1:
if options.sync == 'pps':
self._u.set_time_unknown_pps(uhd.time_spec())
cmd_time = self._u.get_time_now() + uhd.time_spec(COMMAND_DELAY)
- for mb_idx in xrange(self._u.get_num_mboards()):
- self._u.set_command_time(cmd_time, mb_idx)
+ try:
+ for mb_idx in xrange(self._u.get_num_mboards()):
+ self._u.set_command_time(cmd_time, mb_idx)
+ command_time_set = True
+ except RuntimeError:
+ sys.stderr.write('[UHD_RX] [WARNING] Failed to set command times.\n')
for chan in self.channels:
tr = self._u.set_center_freq(treq, chan)
if tr == None:
sys.stderr.write('[UHD_RX] [ERROR] Failed to set center frequency on channel {chan}\n'.format(chan=chan))
exit(1)
- if len(self.channels) > 1:
+ if command_time_set:
for mb_idx in xrange(self._u.get_num_mboards()):
self._u.clear_command_time(mb_idx)
print("[UHD_RX] Syncing channels...")