<p>laforge <strong>submitted</strong> this change.</p><p><a href="https://gerrit.osmocom.org/c/osmo-ccid-firmware/+/19472">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  laforge: Looks good to me, approved
  Jenkins Builder: Verified

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">relax the timeouts<br><br>High baud rates lead to incredibly small wait times that are infeasible<br>as long as software timers are being used, but this is not really a<br>problem - they can just be increased to a reasonable value.<br>At the end of the day the timers need to take the latency of the<br>firmware into account, and timeouts only occur on powerup with wrong<br>voltages/dead cards, or in rare error cases.<br>The actual timeout value does therefore not really matter that much.<br><br>Change-Id: Icb733f2d46f45c1a7dcd2abe6bc292bd41d6b9c2<br>---<br>M ccid_common/cuart.c<br>1 file changed, 9 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/ccid_common/cuart.c b/ccid_common/cuart.c</span><br><span>index 1d777f9..7094a86 100644</span><br><span>--- a/ccid_common/cuart.c</span><br><span>+++ b/ccid_common/cuart.c</span><br><span>@@ -52,9 +52,16 @@</span><br><span>      if(!cuart->current_wtime_byte)</span><br><span>            return;</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+   int etu_in_us = get_etu_in_us(cuart) + 1;</span><br><span style="color: hsl(120, 100%, 40%);">+     cuart->wtime_etu = cuart->wtime_etu ? cuart->wtime_etu : 1;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>       /* timemout is wtime * ETU + expected number of bytes * (12ETU+1 slack)ETU */</span><br><span style="color: hsl(0, 100%, 40%);">-   usecs = get_etu_in_us(cuart) * cuart->wtime_etu +</span><br><span style="color: hsl(0, 100%, 40%);">-                    get_etu_in_us(cuart) * cuart->current_wtime_byte * (12+1);</span><br><span style="color: hsl(120, 100%, 40%);">+ usecs = etu_in_us * cuart->wtime_etu +</span><br><span style="color: hsl(120, 100%, 40%);">+                     etu_in_us * cuart->current_wtime_byte * (12+1);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+  /* limit lower wait time to reasonable value */</span><br><span style="color: hsl(120, 100%, 40%);">+       usecs = usecs < 300000 ? 300000 : usecs;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>        if (usecs > 1000000) {</span><br><span>            secs = usecs / 1000000;</span><br><span>              usecs = usecs % 1000000;</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-ccid-firmware/+/19472">change 19472</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/osmo-ccid-firmware/+/19472"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-ccid-firmware </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: Icb733f2d46f45c1a7dcd2abe6bc292bd41d6b9c2 </div>
<div style="display:none"> Gerrit-Change-Number: 19472 </div>
<div style="display:none"> Gerrit-PatchSet: 5 </div>
<div style="display:none"> Gerrit-Owner: Hoernchen <ewild@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>