<div dir="ltr"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Cool, thanks! Just a few comments from a quick skim:<br>

&gt; -        return &quot;Memory %i: %s%s%s %s (%s) r%.1f%s c%.1f%s d%03i%s%s [%.2f]&quot;% \<br>&gt; +        return &quot;Memory %s: %s%s%s %s (%s) r%.1f%s c%.1f%s d%03i%s%s [%.2f]&quot;% \<br>The number is an integer, so this doesn&#39;t make sense, AFAICT.<br>

</blockquote><div><br></div><div>aw shucks, you&#39;re totally right. I had it in there before I figured out how to use special channels correctly.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

&gt; +    #if data != radio._mmap[:32]:<br>&gt; +        #raise errors.RadioError(&quot;Model mis-match: \n%s\n%s&quot; % (util.hexprint(data),<br>&gt; +                                                               #util.hexprint(radio._mmap[:32])))<br>

Why is this commented-out?<br></blockquote><div><br></div><div>Thanks for catching that! Disabled it while getting the hang of the memory layout and forgot to re-enable</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

&gt; +<br>&gt; +    for i in range(0, 0x4000, 0x20):<br>&gt; +        addr = i + 0x20<br>&gt; +        msg = struct.pack(&quot;&gt;cHb&quot;, &quot;W&quot;, i, 0x20)<br>&gt; +        msg += radio._mmap[addr:addr+0x20]<br>

Need space around the + operator here<br></blockquote><div> </div><div>Fixed.</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

&gt; +    def _decode_tone(self, toneval):<br>&gt; +        pol = &quot;N&quot;<br>&gt; +        rawval = (toneval[1].get_bits(0xFF) &lt;&lt; 8) | toneval[0].get_bits(0xFF)<br>Doesn&#39;t this just mean you need to use the other endianess of your toneval?<br>

</blockquote><div><br></div><div>I copy-pasted from thuv1f.py without thinking too hard about it. There&#39;s a bunch more code in _decode_tone and _encode_tone that rely on this particular endianness. Can we just leave it as-is, since the other code does it this way?</div>









<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">&gt; +        if isinstance(number, int):<br>

&gt; +            enabled = self._memobj.enable[(number - 1) / 8].flags[7-((number - 1) % 8)]<br>&gt; +            dont_skip = self._memobj.skip[(number - 1) / 8].flags[7-((number - 1) % 8)]<br>Need space around the - operator.<br>

</blockquote><div><br></div><div>fixed</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">&gt; +        if dont_skip:<br>

&gt; +          mem.skip = &quot;&quot;<br>&gt; +        else:<br>&gt; +          mem.skip = &quot;S&quot;<br>This should be four-space indented.<br></blockquote><div><br></div><div>fixed</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

Also, this could be compacted to:<br>  mem.skip = &quot;S&quot; if not dont_skip else &quot;&quot;<br></blockquote><div><br></div><div>Thanks! fixed</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

&gt; +        if mem.empty:<br>&gt; +            _mem.set_raw(&quot;\xFF&quot; * 32)<br>&gt; +            self._memobj.enable[(mem.number - 1) / 8].flags[7-((mem.number - 1) % 8)] = False<br>&gt; +            self._memobj.skip[(mem.number - 1) / 8].flags[7-((mem.number - 1) % 8)] = False<br>

&gt; +            return<br>&gt; +        else:<br>&gt; +            self._memobj.enable[(mem.number - 1) / 8].flags[7-((mem.number - 1) % 8)] = True</blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

Need spaces around the - operator.<br></blockquote><div>fixed</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

&gt; +        self._memobj.skip[(mem.number - 1) / 8].flags[7-((mem.number - 1) % 8)] = (mem.skip == &quot;&quot;)<br>Here too.<br></blockquote><div><br></div><div>fixed</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<br>On Mon, Oct 7, 2013 at 8:00 AM, Dan Smith &lt;<a href="mailto:dsmith@danplanet.com">dsmith@danplanet.com</a>&gt; wrote:<br>&gt;<br>&gt; &gt; I acquired a TYT TH-UVF8D several months back, and I&#39;ve finally found<br>

&gt; &gt; the time to finish off adding support for it to CHIRP. In adding support<br>&gt; &gt; for editing the VFO channels as &quot;Special Channels&quot;, I had to make a<br>&gt; &gt; small tweak to the command-line utility so it didn&#39;t choke on<br>

&gt; &gt; non-numeric channel names. Attached is the patch for that, the patch for<br>&gt; &gt; the radio, and an image file dumped from the radio for testing purposes.<br>&gt;<br>&gt; Cool, thanks! Just a few comments from a quick skim:<br>

&gt;<br>&gt; &gt; -        return &quot;Memory %i: %s%s%s %s (%s) r%.1f%s c%.1f%s d%03i%s%s [%.2f]&quot;% \<br>&gt; &gt; +        return &quot;Memory %s: %s%s%s %s (%s) r%.1f%s c%.1f%s d%03i%s%s [%.2f]&quot;% \<br>&gt;<br>

&gt; The number is an integer, so this doesn&#39;t make sense, AFAICT.<br>&gt;<br>&gt; &gt; +    #if data != radio._mmap[:32]:<br>&gt; &gt; +        #raise errors.RadioError(&quot;Model mis-match: \n%s\n%s&quot; % (util.hexprint(data),<br>

&gt; &gt; +                                                               #util.hexprint(radio._mmap[:32])))<br>&gt;<br>&gt; Why is this commented-out?<br>&gt;<br>&gt; &gt; +<br>&gt; &gt; +    for i in range(0, 0x4000, 0x20):<br>

&gt; &gt; +        addr = i + 0x20<br>&gt; &gt; +        msg = struct.pack(&quot;&gt;cHb&quot;, &quot;W&quot;, i, 0x20)<br>&gt; &gt; +        msg += radio._mmap[addr:addr+0x20]<br>&gt;<br>&gt; Need space around the + operator here<br>

&gt;<br>&gt; &gt; +    def _decode_tone(self, toneval):<br>&gt; &gt; +        pol = &quot;N&quot;<br>&gt; &gt; +        rawval = (toneval[1].get_bits(0xFF) &lt;&lt; 8) | toneval[0].get_bits(0xFF)<br>&gt;<br>&gt; Doesn&#39;t this just mean you need to use the other endianess of your toneval?<br>

&gt;<br>&gt; &gt; +        if isinstance(number, int):<br>&gt; &gt; +            enabled = self._memobj.enable[(number - 1) / 8].flags[7-((number - 1) % 8)]<br>&gt; &gt; +            dont_skip = self._memobj.skip[(number - 1) / 8].flags[7-((number - 1) % 8)]<br>

&gt;<br>&gt; Need space around the - operator.<br>&gt;<br>&gt; &gt; +        if dont_skip:<br>&gt; &gt; +          mem.skip = &quot;&quot;<br>&gt; &gt; +        else:<br>&gt; &gt; +          mem.skip = &quot;S&quot;<br>&gt;<br>

&gt; This should be four-space indented.<br>&gt;<br>&gt; Also, this could be compacted to:<br>&gt;<br>&gt;   mem.skip = &quot;S&quot; if not dont_skip else &quot;&quot;<br>&gt;<br>&gt; &gt; +        if mem.empty:<br>&gt; &gt; +            _mem.set_raw(&quot;\xFF&quot; * 32)<br>

&gt; &gt; +            self._memobj.enable[(mem.number - 1) / 8].flags[7-((mem.number - 1) % 8)] = False<br>&gt; &gt; +            self._memobj.skip[(mem.number - 1) / 8].flags[7-((mem.number - 1) % 8)] = False<br>&gt; &gt; +            return<br>

&gt; &gt; +        else:<br>&gt; &gt; +            self._memobj.enable[(mem.number - 1) / 8].flags[7-((mem.number - 1) % 8)] = True<br>&gt;<br>&gt; Need spaces around the - operator.<br>&gt;<br>&gt; &gt; +        self._memobj.skip[(mem.number - 1) / 8].flags[7-((mem.number - 1) % 8)] = (mem.skip == &quot;&quot;)<br>

&gt;<br>&gt; Here too.<br>&gt;<br>&gt; --<br>&gt; Dan Smith<br>&gt; <a href="http://www.danplanet.com">www.danplanet.com</a><br>&gt; KK7DS<br>&gt;<br>&gt;<br>&gt; _______________________________________________<br>&gt; chirp_devel mailing list<br>

&gt; <a href="mailto:chirp_devel@intrepid.danplanet.com">chirp_devel@intrepid.danplanet.com</a><br>&gt; <a href="http://intrepid.danplanet.com/mailman/listinfo/chirp_devel">http://intrepid.danplanet.com/mailman/listinfo/chirp_devel</a><br>

&gt; Developer docs: <a href="http://chirp.danplanet.com/projects/chirp/wiki/Developers">http://chirp.danplanet.com/projects/chirp/wiki/Developers</a></blockquote></div>