summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreb2007-05-30 19:26:46 +0000
committereb2007-05-30 19:26:46 +0000
commit22988d507235d59cc168408e8dee8f0210153701 (patch)
treeff9d270fa0a3d3bf4e5d01207324453daa597e03
parente60ca726639d6588b243241d38d28a094404dbb7 (diff)
downloadgnuradio-22988d507235d59cc168408e8dee8f0210153701.tar.gz
gnuradio-22988d507235d59cc168408e8dee8f0210153701.tar.bz2
gnuradio-22988d507235d59cc168408e8dee8f0210153701.zip
Added error checking on call to set_freq
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@5577 221aa14e-8319-0410-a670-987f0aec2ac5
-rwxr-xr-xgnuradio-examples/python/usrp/fm_tx4.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/gnuradio-examples/python/usrp/fm_tx4.py b/gnuradio-examples/python/usrp/fm_tx4.py
index da887d8bf..7e5023ddb 100755
--- a/gnuradio-examples/python/usrp/fm_tx4.py
+++ b/gnuradio-examples/python/usrp/fm_tx4.py
@@ -104,7 +104,13 @@ class fm_tx_graph (stdgui.gui_flow_graph):
print "Using TX d'board %s" % (self.subdev.side_and_name(),)
self.subdev.set_gain(self.subdev.gain_range()[1]) # set max Tx gain
- self.set_freq(options.freq)
+ if not self.set_freq(options.freq):
+ freq_range = self.subdev.freq_range()
+ print "Failed to set frequency to %s. Daughterboard supports %s to %s" % (
+ eng_notation.num_to_str(options.freq),
+ eng_notation.num_to_str(freq_range[0]),
+ eng_notation.num_to_str(freq_range[1]))
+ raise SystemExit
self.subdev.set_enable(True) # enable transmitter
sum = gr.add_cc ()