[chirp_devel] [PATCH] [KG-UV6D] DTCS Bug in Wouxun Driver
# HG changeset patch # User Jim Unroe rock.unroe@gmail.com # Date 1489020213 18000 # Node ID 75eea458e10dc98f6876a1d8ff60ad2228702f08 # Parent e77add13fe0863f0548efa7d2c65ca702092e172 [KG-UV6D] DTCS Bug in Wouxun Driver
This patch addresses the bug where the DTCS Tone value can't but updated when Tone Mode is set to DTCS.
Related to #4585
diff -r e77add13fe08 -r 75eea458e10d chirp/drivers/tk8102.py --- a/chirp/drivers/tk8102.py Wed Mar 08 19:28:09 2017 -0500 +++ b/chirp/drivers/tk8102.py Wed Mar 08 19:43:33 2017 -0500 @@ -302,30 +302,33 @@ val += 0xA000 return val
- if mem.tmode == "Cross": + rx_mode = tx_mode = None + rx_tone = tx_tone = 0xFFFF + + if mem.tmode == "Tone": + tx_mode = "Tone" + rx_mode = None + tx_tone = int(mem.rtone * 10) + elif mem.tmode == "TSQL": + rx_mode = tx_mode = "Tone" + rx_tone = tx_tone = int(mem.ctone * 10) + elif mem.tmode == "DTCS": + tx_mode = rx_mode = "DTCS" + tx_tone = _set_dcs(mem.dtcs, mem.dtcs_polarity[0]) + rx_tone = _set_dcs(mem.dtcs, mem.dtcs_polarity[1]) + elif mem.tmode == "Cross": tx_mode, rx_mode = mem.cross_mode.split("->") - elif mem.tmode == "Tone": - tx_mode = mem.tmode - rx_mode = None - else: - tx_mode = rx_mode = mem.tmode + if tx_mode == "DTCS": + tx_tone = _set_dcs(mem.dtcs, mem.dtcs_polarity[0]) + elif tx_mode == "Tone": + tx_tone = int(mem.rtone * 10) + if rx_mode == "DTCS": + rx_tone = _set_dcs(mem.rx_dtcs, mem.dtcs_polarity[1]) + elif rx_mode == "Tone": + rx_tone = int(mem.ctone * 10)
- if tx_mode == "DTCS": - _mem.tx_tone = mem.tmode != "DTCS" and \ - _set_dcs(mem.dtcs, mem.dtcs_polarity[0]) or \ - _set_dcs(mem.rx_dtcs, mem.dtcs_polarity[0]) - elif tx_mode: - _mem.tx_tone = tx_mode == "Tone" and \ - int(mem.rtone * 10) or int(mem.ctone * 10) - else: - _mem.tx_tone = 0xFFFF - - if rx_mode == "DTCS": - _mem.rx_tone = _set_dcs(mem.rx_dtcs, mem.dtcs_polarity[1]) - elif rx_mode: - _mem.rx_tone = int(mem.ctone * 10) - else: - _mem.rx_tone = 0xFFFF + _mem.rx_tone = rx_tone + _mem.tx_tone = tx_tone
LOG.debug("Set TX %s (%i) RX %s (%i)" % (tx_mode, _mem.tx_tone, rx_mode, _mem.rx_tone)) diff -r e77add13fe08 -r 75eea458e10d chirp/drivers/wouxun.py --- a/chirp/drivers/wouxun.py Wed Mar 08 19:28:09 2017 -0500 +++ b/chirp/drivers/wouxun.py Wed Mar 08 19:43:33 2017 -0500 @@ -810,30 +810,33 @@ val += 0x8000 return val
- if mem.tmode == "Cross": + rx_mode = tx_mode = None + rx_tone = tx_tone = 0xFFFF + + if mem.tmode == "Tone": + tx_mode = "Tone" + rx_mode = None + tx_tone = int(mem.rtone * 10) + elif mem.tmode == "TSQL": + rx_mode = tx_mode = "Tone" + rx_tone = tx_tone = int(mem.ctone * 10) + elif mem.tmode == "DTCS": + tx_mode = rx_mode = "DTCS" + tx_tone = _set_dcs(mem.dtcs, mem.dtcs_polarity[0]) + rx_tone = _set_dcs(mem.dtcs, mem.dtcs_polarity[1]) + elif mem.tmode == "Cross": tx_mode, rx_mode = mem.cross_mode.split("->") - elif mem.tmode == "Tone": - tx_mode = mem.tmode - rx_mode = None - else: - tx_mode = rx_mode = mem.tmode + if tx_mode == "DTCS": + tx_tone = _set_dcs(mem.dtcs, mem.dtcs_polarity[0]) + elif tx_mode == "Tone": + tx_tone = int(mem.rtone * 10) + if rx_mode == "DTCS": + rx_tone = _set_dcs(mem.rx_dtcs, mem.dtcs_polarity[1]) + elif rx_mode == "Tone": + rx_tone = int(mem.ctone * 10)
- if tx_mode == "DTCS": - _mem.tx_tone = mem.tmode != "DTCS" and \ - _set_dcs(mem.dtcs, mem.dtcs_polarity[0]) or \ - _set_dcs(mem.rx_dtcs, mem.dtcs_polarity[0]) - elif tx_mode: - _mem.tx_tone = tx_mode == "Tone" and \ - int(mem.rtone * 10) or int(mem.ctone * 10) - else: - _mem.tx_tone = 0xFFFF - - if rx_mode == "DTCS": - _mem.rx_tone = _set_dcs(mem.rx_dtcs, mem.dtcs_polarity[1]) - elif rx_mode: - _mem.rx_tone = int(mem.ctone * 10) - else: - _mem.rx_tone = 0xFFFF + _mem.rx_tone = rx_tone + _mem.tx_tone = tx_tone
LOG.debug("Set TX %s (%i) RX %s (%i)" % (tx_mode, _mem.tx_tone, rx_mode, _mem.rx_tone))
participants (1)
-
Jim Unroe