<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Sep 11, 2017 at 5:22 AM, Jef Driesen <span dir="ltr"><<a href="mailto:jef@libdivecomputer.org" target="_blank">jef@libdivecomputer.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-">On 2017-09-06 22:02, John Van Ostrand wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
The parameters used with the FTDI USB serial port drivers didn't<br>
work well with directly with libftdi1. The new baud rate results<br>
in the same effective baud rates for both.<br>
</blockquote>
<br></span>
What's the effective baudrate? Why don't you just use that effective baudrate, instead of 850000? Now the baudrate change looks rather arbitrary to me.<br>
<br>
Other than that, the changes look good to me. For the retrying, I'll restore the old retry function (see commit b3d2c603ddec9758fb36706bbde46c<wbr>e23ca9f0ed) because it handles fatal errors better.</blockquote><div><br></div><div>I was working with FTDI to get mobile communications to work and high-speed data was coming back with bit 7 set on all bytes. While I was tracking that down I noticed that at the USB packet level the baud rate command was different, there was a different clock divisor for the custom baud rate. Clearly the ftdi_sio kernel module that translates serial commands to FTDI was translating baud differently than the libftdi1 library routines. I suspect either the logic is different or one of them is wrong about which FTDI chip it's talking to. I didn't debug deeper than that. I translated the working divisor back to a baud rate which turned out to be 857,143 baud. I expect the actual baud rate is tied to the clock on the CPU of the dive computer, we don't know what that is, so stating 857,143 as the baud rate suggests accuracy. I figured 850,000 was within the 5% required by the libftdi1 logic, visually more reasonable and about as wrong as 857,143.</div></div><br clear="all"><div>I'll give that commit a try to see how it works. I know that one of the problems I was having was that after a baud rate change a heartbeat byte would be received at the wrong baud rate and show up as a 0xFE, that's the only case that is a permanent failure if we used that commit. I'm starting to wonder if the serial flush command given to the FTDI chip is working, or if the DC ignores the baud rate change some times. </div><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div>John Van Ostrand<br></div><div>At large on sabbatical<br></div><br></div></div>
</div></div>