[chirp_devel] [PATCH] [vx8] Add support for 8.33kHz airband step. Fixes #3425
# HG changeset patch # User Mario Haustein dm5aha@darc.de # Date 1530460330 -7200 # Sun Jul 01 17:52:10 2018 +0200 # Node ID 4f6978a84b3e461b13c6e0f996d3bec058431b70 # Parent e57a01e2106af3cb98101e37ee164612fe2f0dad [vx8] Add support for 8.33kHz airband step. Fixes #3425
diff -r e57a01e2106a -r 4f6978a84b3e chirp/chirp_common.py --- a/chirp/chirp_common.py Wed Jun 20 06:10:36 2018 -0700 +++ b/chirp/chirp_common.py Sun Jul 01 17:52:10 2018 +0200 @@ -1286,6 +1286,11 @@ return (freq % 2500) == 0
+def is_8_33(freq): + """Returns True if @freq is reachable by a 8.33kHz step""" + return (freq % 25000) in [ 0, 8330, 16660 ] + + def required_step(freq): """Returns the simplest tuning step that is required to reach @freq""" if is_5_0(freq): @@ -1296,6 +1301,8 @@ return 6.25 elif is_2_5(freq): return 2.5 + elif is_8_33(freq): + return 8.33 else: raise errors.InvalidDataError("Unable to calculate the required " + "tuning step for %i.%5i" % @@ -1329,6 +1336,18 @@ except errors.InvalidDataError: pass
+ try: + required_step(freq + 330) + return float(freq + 330) + except errors.InvalidDataError: + pass + + try: + required_step(freq + 660) + return float(freq + 660) + except errors.InvalidDataError: + pass + raise errors.InvalidDataError("Unable to correct rounded frequency " + format_freq(freq))
diff -r e57a01e2106a -r 4f6978a84b3e chirp/drivers/vx8.py --- a/chirp/drivers/vx8.py Wed Jun 20 06:10:36 2018 -0700 +++ b/chirp/drivers/vx8.py Sun Jul 01 17:52:10 2018 +0200 @@ -336,7 +336,7 @@ STEPS = list(chirp_common.TUNING_STEPS) STEPS.remove(30.0) STEPS.append(100.0) -STEPS.insert(2, 0.0) # There is a skipped tuning step at index 2 (?) +STEPS.insert(2, 8.33) # Index 2 is 8.33kHz airband step SKIPS = ["", "S", "P"] VX8_DTMF_CHARS = list("0123456789ABCD*#-")
participants (1)
-
Mario Haustein