<p>laforge has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/simtrace2/+/23641">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">card_emu: improve reset detection conditions<br><br>* enter ISO_S_WAIT_RST when RST is asserted<br>* enter ISO_S_WAIT_ATR only when we RST is released while in state ISO_S_WAIT_RST<br><br>Change-Id: I620333aa8d45561a8028b948955a27f667b58406<br>---<br>M firmware/libcommon/source/card_emu.c<br>1 file changed, 2 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/41/23641/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/firmware/libcommon/source/card_emu.c b/firmware/libcommon/source/card_emu.c</span><br><span>index c5e4cfa..216ffe3 100644</span><br><span>--- a/firmware/libcommon/source/card_emu.c</span><br><span>+++ b/firmware/libcommon/source/card_emu.c</span><br><span>@@ -1102,7 +1102,7 @@</span><br><span>        case CARD_IO_RST:</span><br><span>            if (active == 0 && ch->in_reset) {</span><br><span>                        TRACE_INFO("%u: RST released\r\n", ch->num);</span><br><span style="color: hsl(0, 100%, 40%);">-                       if (ch->vcc_active && ch->clocked) {</span><br><span style="color: hsl(120, 100%, 40%);">+                    if (ch->vcc_active && ch->clocked && ch->state == ISO_S_WAIT_RST) {</span><br><span>                                 /* enable the TC/ETU counter once reset has been released */</span><br><span>                                 tc_etu_enable(ch->tc_chan);</span><br><span>                               /* prepare to send the ATR */</span><br><span>@@ -1113,6 +1113,7 @@</span><br><span>                        TRACE_INFO("%u: RST asserted\r\n", ch->num);</span><br><span>                    card_handle_reset(ch);</span><br><span>                       chg_mask |= CEMU_STATUS_F_RESET_ACTIVE;</span><br><span style="color: hsl(120, 100%, 40%);">+                       card_set_state(ch, ISO_S_WAIT_RST);</span><br><span>          }</span><br><span>            ch->in_reset = active;</span><br><span>            break;</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/simtrace2/+/23641">change 23641</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/simtrace2/+/23641"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: simtrace2 </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I620333aa8d45561a8028b948955a27f667b58406 </div>
<div style="display:none"> Gerrit-Change-Number: 23641 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-CC: Jenkins Builder </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>