<div dir="auto">Hold off on applying this. It doesn't work as intended. <div dir="auto"><br></div><div dir="auto">Tom </div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mar 17, 2017 22:00, "Tom Hayward" <<a href="mailto:esarfl@gmail.com">esarfl@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"># HG changeset patch<br>
# User Tom Hayward <<a href="mailto:tom@tomh.us">tom@tomh.us</a>><br>
# Date 1489813179 25200<br>
# Fri Mar 17 21:59:39 2017 -0700<br>
# Node ID 027d861a73342f6208f4f977d844b2<wbr>caf4be5721<br>
# Parent 6b5b397b4859dd64603d7c4a0b91ff<wbr>dbdfbe2bb6<br>
[THD72] Fix buggy memory initialization. #1611<br>
<br>
Allows channels added by Chirp to transmit. As a side effect, transmit inhibit<br>
is now optional (rather than compulsary).<br>
<br>
diff -r 6b5b397b4859 -r 027d861a7334 chirp/drivers/thd72.py<br>
--- a/chirp/drivers/thd72.py Fri Mar 17 15:17:57 2017 -0700<br>
+++ b/chirp/drivers/thd72.py Fri Mar 17 21:59:39 2017 -0700<br>
@@ -90,7 +90,7 @@<br>
#seekto 0x0c00;<br>
struct {<br>
u8 disabled:7,<br>
- unknown0:1;<br>
+ txinhibit:1;<br>
u8 skip;<br>
} flag[1032];<br>
<br>
@@ -183,9 +183,6 @@<br>
EXCH_R = "R\x00\x00\x00\x00"<br>
EXCH_W = "W\x00\x00\x00\x00"<br>
<br>
-# Uploads result in "MCP Error" and garbage data in memory<br>
-# Clone driver disabled in favor of error-checking live driver.<br>
-<br>
<br>
@directory.register<br>
class THD72Radio(chirp_common.<wbr>CloneModeRadio):<br>
@@ -224,7 +221,7 @@<br>
rf.valid_tuning_steps = []<br>
rf.valid_modes = MODES_REV.keys()<br>
rf.valid_tmodes = TMODES_REV.keys()<br>
- rf.valid_duplexes = DUPLEX_REV.keys()<br>
+ rf.valid_duplexes = DUPLEX_REV.keys() + ["off"]<br>
rf.valid_skips = ["", "S"]<br>
rf.valid_characters = chirp_common.CHARSET_<wbr>ALPHANUMERIC<br>
rf.valid_name_length = 8<br>
@@ -283,7 +280,7 @@<br>
<br>
def get_raw_memory(self, number):<br>
return repr(self._memobj.memory[<wbr>number]) + \<br>
- repr(self._memobj.flag[(<wbr>number)])<br>
+ repr(self._memobj.flag[number]<wbr>)<br>
<br>
def get_memory(self, number):<br>
if isinstance(number, str):<br>
@@ -315,7 +312,7 @@<br>
mem.rtone = chirp_common.TONES[_mem.rtone]<br>
mem.ctone = chirp_common.TONES[_mem.ctone]<br>
mem.dtcs = chirp_common.DTCS_CODES[_mem.<wbr>dtcs]<br>
- mem.duplex = DUPLEX[int(_mem.duplex)]<br>
+ mem.duplex = flag.txinhibit and "off" or DUPLEX[int(_mem.duplex)]<br>
mem.offset = int(_mem.offset)<br>
mem.mode = MODES[int(_mem.mode)]<br>
<br>
@@ -369,7 +366,8 @@<br>
_mem.ctone = chirp_common.TONES.index(mem.<wbr>ctone)<br>
_mem.dtcs = chirp_common.DTCS_CODES.index(<wbr>mem.dtcs)<br>
_mem.cross_mode = chirp_common.CROSS_MODES.<wbr>index(mem.cross_mode)<br>
- _mem.duplex = DUPLEX_REV[mem.duplex]<br>
+ flag.txinhibit = mem.duplex == "off"<br>
+ _mem.duplex = DUPLEX_REV.get(mem.duplex, 0)<br>
_mem.offset = mem.offset<br>
_mem.mode = MODES_REV[mem.mode]<br>
<br>
@@ -509,9 +507,8 @@<br>
raise errors.RadioError("No response to ID command")<br>
<br>
def initialize(self, mmap):<br>
- mmap[0] = \<br>
- "\x80\xc8\xb3\x08\x00\x01\x00\<wbr>x08" + \<br>
- "\x08\x00\xc0\x27\x09\x00\x00\<wbr>xff"<br>
+ mmap.set_raw("\x00\xc8\xb3\<wbr>x08\x00\x01\x00\x08"<br>
+ "\x08\x00\xc0\x27\x09\x00\x00\<wbr>x00")<br>
<br>
def _get_settings(self):<br>
top = RadioSettings(self._get_<wbr>display_settings(),<br>
</blockquote></div></div>