[chirp_devel] Revised patch for #8339
Rick (AA0RD) DeWitt
Tue Nov 17 06:36:18 PST 2020
Stupid operator saved the revised driver with the Windows EOL instead of
Unix.
Here is the revised patch with Unix EOL and some style corrections.
Driver fix is a simple 100ms delay between download reads.
--
Rick DeWitt
AA0RD
Sequim, Washington, USA 98382
(360) 681-3494
-------------- next part --------------
# HG changeset patch
# User Rick DeWitt <aa0rd at yahoo.com>
# Date 1605623144 28800
# Tue Nov 17 06:25:44 2020 -0800
# Node ID 3d08cc33c84429bdc1d9d5130f4de58a0470ae31
# Parent 98b8a850b0f136c77fe09a4922c32a2a28f708be
[th_uv8000] Issue # 8339, Priority channel: OFF now enabled
Allowed priority channel number to be 0
diff -r 98b8a850b0f1 -r 3d08cc33c844 chirp/drivers/th_uv8000.py
--- a/chirp/drivers/th_uv8000.py Sun Oct 11 15:39:26 2020 -0400
+++ b/chirp/drivers/th_uv8000.py Tue Nov 17 06:25:44 2020 -0800
@@ -1,5 +1,6 @@
-# Copyright 2019: Rick DeWitt (RJD), <aa0rd at yahoo.com>
-# Version 1.0 for TYT-UV8000D/E
+# Copyright 2020: Rick DeWitt (RJD), <aa0rd at yahoo.com>
+# Version 1.1 for TYT-UV8000D/E
+# V1.1 fixes issue #8339 Priority scan channel: OFF
# Thanks to Damon Schaefer (K9CQB) and the Loudoun County, VA ARES
# club for the donated radio.
# And thanks to Ian Harris (VA3IHX) for decoding the memory map.
@@ -468,7 +469,6 @@
else:
_mem.txtone[1] = _mem.txtone[1] | 0x80
- return 0
def _do_map(chn, sclr, mary):
@@ -554,8 +554,8 @@
rf.has_settings = True
rf.has_bank = False
rf.has_comment = False
- rf.has_nostep_tuning = True # Radio accepts any entered freq
- rf.has_tuning_step = False # Not as chan feature
+ rf.has_nostep_tuning = True # Radio accepts any entered freq
+ rf.has_tuning_step = False # Not as chan feature
rf.can_odd_split = False
rf.has_name = True
rf.has_offset = True
@@ -574,7 +574,6 @@
rf.valid_cross_modes = ["Tone->Tone", "DTCS->", "->DTCS",
"Tone->DTCS", "DTCS->Tone", "->Tone",
"DTCS->DTCS"]
- rf.valid_skips = []
rf.valid_power_levels = POWER_LEVELS
rf.valid_dtcs_codes = self.DTCS_CODES
rf.valid_bands = self.VALID_BANDS
@@ -935,7 +934,6 @@
# This call back also used in get_settings
value = int(str(setting.value)) # Get the integer value
setattr(obj, atrb, value)
- return
def my_adjraw(setting, obj, atrb, fix):
"""Callback from Integer add or subtract fix from value."""
@@ -944,7 +942,6 @@
if value < 0:
value = 0
setattr(obj, atrb, value)
- return
def my_strnam(setting, obj, atrb, mln):
"""Callback from String to build u8 array with -32 offset."""
@@ -964,7 +961,6 @@
else:
ary.append(0)
setattr(obj, atrb, ary)
- return
def unpack_str(cary, cknt, mxw):
"""Convert u8 nibble array to a string: NOT a callback."""
@@ -1035,19 +1031,16 @@
else:
cknt = 0xf
setattr(obj, atrcnt, cknt)
- return
def myset_freq(setting, obj, atrb, mult):
""" Callback to set frequency by applying multiplier"""
value = int(float(str(setting.value)) * mult)
setattr(obj, atrb, value)
- return
def my_invbool(setting, obj, atrb):
"""Callback to invert the boolean """
bval = not setting.value
setattr(obj, atrb, bval)
- return
def my_batsav(setting, obj, atrb):
"""Callback to set batsav attribute """
@@ -1064,7 +1057,6 @@
value = 0x7 # On, ratio 3 = 1:4
# LOG.warning("Batsav stx:%s:, value= %x" % (stx, value))
setattr(obj, atrb, value)
- return
def my_manfrq(setting, obj, atrb):
"""Callback to set 2-byte manfrqyn yes/no """
@@ -1074,7 +1066,6 @@
else:
value = 0xaa
setattr(obj, atrb, value)
- return
def myset_mask(setting, obj, atrb, nx):
if bool(setting.value): # Enabled = 0
@@ -1082,7 +1073,6 @@
else:
vx = 1
_do_map(nx + 1, vx, self._memobj.fmmap.fmset)
- return
def myset_fmfrq(setting, obj, atrb, nx):
""" Callback to set xx.x FM freq in memory as xx.x * 40"""
@@ -1090,7 +1080,6 @@
vx = float(str(setting.value))
vx = int(vx * 40)
setattr(obj[nx], atrb, vx)
- return
rx = RadioSettingValueInteger(1, 9, _sets.voxgain + 1)
rset = RadioSetting("setstuf.voxgain", "Vox Level", rx)
@@ -1251,9 +1240,9 @@
val = _sets.prichan
if val <= 0:
- val = 1
- rx = RadioSettingValueInteger(1, 128, val)
- rset = RadioSetting("setstuf.prichan", "Priority Channel", rx)
+ val = 0
+ rx = RadioSettingValueInteger(0, 128, val)
+ rset = RadioSetting("setstuf.prichan", "Priority Channel (0=OFF)", rx)
scn.append(rset)
# FM Broadcast Settings
More information about the chirp_devel
mailing list