<div dir="ltr">Same message and patch, but I wasn&#39;t sure the one from gmail got through due to mailing list configuration. Sorry for the confusion!<div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Nov 15, 2013 at 5:34 PM, Dan Smith <span dir="ltr">&lt;<a href="mailto:dsmith@danplanet.com" target="_blank">dsmith@danplanet.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This looks like a repeat of your mail from 10/31. Is this patch<br>
different? Which one should I look at?<br>
<br>
--Dan<br>
<div><div class="h5"><br>
On 11/05/2013 12:18 PM, Eric Allen wrote:<br>
&gt;     Cool, thanks! Just a few comments from a quick skim:<br>
&gt;     &gt; -        return &quot;Memory %i: %s%s%s %s (%s) r%.1f%s c%.1f%s<br>
&gt;     d%03i%s%s [%.2f]&quot;% \<br>
&gt;     &gt; +        return &quot;Memory %s: %s%s%s %s (%s) r%.1f%s c%.1f%s<br>
&gt;     d%03i%s%s [%.2f]&quot;% \<br>
&gt;     The number is an integer, so this doesn&#39;t make sense, AFAICT.<br>
&gt;<br>
&gt;<br>
&gt; aw shucks, you&#39;re totally right. I had it in there before I figured out<br>
&gt; how to use special channels correctly.<br>
&gt;<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; %<br>
&gt;     (util.hexprint(data),<br>
&gt;     &gt; +<br>
&gt;     #util.hexprint(radio._mmap[:32])))<br>
&gt;     Why is this commented-out?<br>
&gt;<br>
&gt;<br>
&gt; Thanks for catching that! Disabled it while getting the hang of the<br>
&gt; memory layout and forgot to re-enable<br>
&gt;<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;     Need space around the + operator here<br>
&gt;<br>
&gt;<br>
&gt; Fixed.<br>
&gt;<br>
&gt;<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) |<br>
&gt;     toneval[0].get_bits(0xFF)<br>
&gt;     Doesn&#39;t this just mean you need to use the other endianess of your<br>
&gt;     toneval?<br>
&gt;<br>
&gt;<br>
&gt; I copy-pasted from thuv1f.py without thinking too hard about it. There&#39;s<br>
&gt; a bunch more code in _decode_tone and _encode_tone that rely on this<br>
&gt; particular endianness. Can we just leave it as-is, since the other code<br>
&gt; does it this way?<br>
&gt;<br>
&gt;<br>
&gt;     &gt; +        if isinstance(number, int):<br>
&gt;     &gt; +            enabled = self._memobj.enable[(number - 1) /<br>
&gt;     8].flags[7-((number - 1) % 8)]<br>
&gt;     &gt; +            dont_skip = self._memobj.skip[(number - 1) /<br>
&gt;     8].flags[7-((number - 1) % 8)]<br>
&gt;     Need space around the - operator.<br>
&gt;<br>
&gt;<br>
&gt; fixed<br>
&gt;<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;     This should be four-space indented.<br>
&gt;<br>
&gt;<br>
&gt; fixed<br>
&gt;<br>
&gt;<br>
&gt;     Also, this could be compacted to:<br>
&gt;       mem.skip = &quot;S&quot; if not dont_skip else &quot;&quot;<br>
&gt;<br>
&gt;<br>
&gt; Thanks! fixed<br>
&gt;<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) /<br>
&gt;     8].flags[7-((mem.number - 1) % 8)] = False<br>
&gt;     &gt; +            self._memobj.skip[(mem.number - 1) /<br>
&gt;     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) /<br>
&gt;     8].flags[7-((mem.number - 1) % 8)] = True<br>
&gt;<br>
&gt;     Need spaces around the - operator.<br>
&gt;<br>
&gt; fixed<br>
&gt;<br>
&gt;<br>
&gt;     &gt; +        self._memobj.skip[(mem.number - 1) /<br>
&gt;     8].flags[7-((mem.number - 1) % 8)] = (mem.skip == &quot;&quot;)<br>
&gt;     Here too.<br>
&gt;<br>
&gt;<br>
&gt; fixed<br>
&gt;<br>
&gt;<br>
&gt; On Mon, Oct 7, 2013 at 8:00 AM, Dan Smith &lt;<a href="mailto:dsmith@danplanet.com">dsmith@danplanet.com</a><br>
</div></div><div><div class="h5">&gt; &lt;mailto:<a href="mailto:dsmith@danplanet.com">dsmith@danplanet.com</a>&gt;&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<br>
&gt;     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<br>
&gt;     patch for<br>
&gt;     &gt; the radio, and an image file dumped from the radio for testing<br>
&gt;     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<br>
&gt;     d%03i%s%s [%.2f]&quot;% \<br>
&gt;     &gt; +        return &quot;Memory %s: %s%s%s %s (%s) r%.1f%s c%.1f%s<br>
&gt;     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; %<br>
&gt;     (util.hexprint(data),<br>
&gt;     &gt; +<br>
&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) |<br>
&gt;     toneval[0].get_bits(0xFF)<br>
&gt;<br>
&gt;     Doesn&#39;t this just mean you need to use the other endianess of your<br>
&gt;     toneval?<br>
&gt;<br>
&gt;     &gt; +        if isinstance(number, int):<br>
&gt;     &gt; +            enabled = self._memobj.enable[(number - 1) /<br>
&gt;     8].flags[7-((number - 1) % 8)]<br>
&gt;     &gt; +            dont_skip = self._memobj.skip[(number - 1) /<br>
&gt;     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) /<br>
&gt;     8].flags[7-((mem.number - 1) % 8)] = False<br>
&gt;     &gt; +            self._memobj.skip[(mem.number - 1) /<br>
&gt;     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) /<br>
&gt;     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) /<br>
&gt;     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>
</div></div>&gt;     <a href="http://www.danplanet.com" target="_blank">www.danplanet.com</a> &lt;<a href="http://www.danplanet.com" target="_blank">http://www.danplanet.com</a>&gt;<br>
<div class="im">&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>
</div>&gt;     &lt;mailto:<a href="mailto:chirp_devel@intrepid.danplanet.com">chirp_devel@intrepid.danplanet.com</a>&gt;<br>
<div class="HOEnZb"><div class="h5">&gt;     <a href="http://intrepid.danplanet.com/mailman/listinfo/chirp_devel" target="_blank">http://intrepid.danplanet.com/mailman/listinfo/chirp_devel</a><br>
&gt;     Developer docs:<br>
&gt;     <a href="http://chirp.danplanet.com/projects/chirp/wiki/Developers" target="_blank">http://chirp.danplanet.com/projects/chirp/wiki/Developers</a><br>
&gt;<br>
&gt;<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" target="_blank">http://intrepid.danplanet.com/mailman/listinfo/chirp_devel</a><br>
&gt; Developer docs: <a href="http://chirp.danplanet.com/projects/chirp/wiki/Developers" target="_blank">http://chirp.danplanet.com/projects/chirp/wiki/Developers</a><br>
&gt;<br>
<br>
</div></div><br>_______________________________________________<br>
chirp_devel mailing list<br>
<a href="mailto:chirp_devel@intrepid.danplanet.com">chirp_devel@intrepid.danplanet.com</a><br>
<a href="http://intrepid.danplanet.com/mailman/listinfo/chirp_devel" target="_blank">http://intrepid.danplanet.com/mailman/listinfo/chirp_devel</a><br>
Developer docs: <a href="http://chirp.danplanet.com/projects/chirp/wiki/Developers" target="_blank">http://chirp.danplanet.com/projects/chirp/wiki/Developers</a><br></blockquote></div><br></div></div>