card_emu: Avoid PTS related race-condition
We should not set the new Fi/Di values before we actually transmitted
the PTSS PCK at the old baud rate first.
diff --git a/firmware/src_simtrace/card_emu.c b/firmware/src_simtrace/card_emu.c
index 8454bc1..5f0ee7c 100644
--- a/firmware/src_simtrace/card_emu.c
+++ b/firmware/src_simtrace/card_emu.c
@@ -364,7 +364,7 @@
}
-static enum iso7816_3_card_state
+static int
process_byte_pts(struct card_handle *ch, uint8_t byte)
{
switch (ch->pts.state) {
@@ -406,6 +406,7 @@
flush_pts(ch);
/* activate UART TX to transmit PTS response */
card_emu_uart_enable(ch->uart_chan, ENABLE_TX);
+ return -1;
}
return ISO_S_IN_PTS;