card_emu: fix set_tpdu_state()

* don't enter a state we are already in
* enable the UART receiver not only when waiting for CLA, but also
  generally when we're waiting for more data from the reader
diff --git a/firmware/src_simtrace/card_emu.c b/firmware/src_simtrace/card_emu.c
index bb5c203..a0968cb 100644
--- a/firmware/src_simtrace/card_emu.c
+++ b/firmware/src_simtrace/card_emu.c
@@ -385,9 +385,14 @@
 
 static void set_tpdu_state(struct card_handle *ch, enum tpdu_state new_ts)
 {
+	if (ch->tpdu.state == new_ts)
+		return;
+
 	TRACE_DEBUG("7816 TPDU state %u -> %u\n", ch->tpdu.state, new_ts);
+
 	switch (new_ts) {
 	case TPDU_S_WAIT_CLA:
+	case TPDU_S_WAIT_RX:
 		card_emu_uart_enable(ch->uart_chan, ENABLE_RX);
 		break;
 	case TPDU_S_WAIT_PB:
@@ -397,6 +402,7 @@
 		card_emu_uart_enable(ch->uart_chan, ENABLE_TX);
 		break;
 	}
+
 	ch->tpdu.state = new_ts;
 }