aboutsummaryrefslogtreecommitdiffstats
path: root/python/trx
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2019-01-19 10:35:55 +0700
committerPiotr Krysik <ptrkrysik@gmail.com>2019-07-18 10:31:27 +0200
commit5819e314509a2ce4774e7c77b3610d7c5e0b7e97 (patch)
treeacf76dcc9b7b17efa4641a3dc8256a0f4cddbdfb /python/trx
parent2cbc3b5d9772752701c3914ed9c3dbdccbe1d0ac (diff)
trx/radio_if.py: do not print anything if freq. shift is 0
Diffstat (limited to 'python/trx')
-rw-r--r--python/trx/radio_if.py18
1 files changed, 10 insertions, 8 deletions
diff --git a/python/trx/radio_if.py b/python/trx/radio_if.py
index ec9cd5f..4032850 100644
--- a/python/trx/radio_if.py
+++ b/python/trx/radio_if.py
@@ -276,19 +276,21 @@ class RadioInterface(gr.top_block):
return self.ppm / 1.0e6 * 2 * pi * fc / self.sample_rate
def set_rx_freq(self, fc):
- fc += self.freq_offset
- print("[#] Shifting RX freq. to %s (offset is %s)"
- % (eng_notation.num_to_str(fc),
- eng_notation.num_to_str(self.freq_offset)))
+ if self.freq_offset != 0:
+ fc += self.freq_offset
+ print("[#] Shifting RX freq. to %s (offset is %s)"
+ % (eng_notation.num_to_str(fc),
+ eng_notation.num_to_str(self.freq_offset)))
self.phy_src.set_center_freq(fc, 0)
self.rotator_src.set_phase_inc(self.calc_phase_inc(fc))
self.rx_freq = fc
def set_tx_freq(self, fc):
- fc += self.freq_offset
- print("[#] Shifting TX freq. to %s (offset is %s)"
- % (eng_notation.num_to_str(fc),
- eng_notation.num_to_str(self.freq_offset)))
+ if self.freq_offset != 0:
+ fc += self.freq_offset
+ print("[#] Shifting TX freq. to %s (offset is %s)"
+ % (eng_notation.num_to_str(fc),
+ eng_notation.num_to_str(self.freq_offset)))
self.phy_sink.set_center_freq(fc, 0)
self.rotator_sink.set_phase_inc(-self.calc_phase_inc(fc))
self.tx_freq = fc