From 4d4405ff3aa54c2894930dbcde5e63f219076423 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sun, 15 Dec 2019 13:23:51 +0100 Subject: [PATCH] card_emu: Remove extraneous code card_set_state(ch, ISO_S_WAIT_ATR) internally calls tc_etu_enable(), so there's no need for the caller to do the same, too. Change-Id: I2a2b4d64c40264623313a867957ffcefe57748f9 --- firmware/libcommon/source/card_emu.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/firmware/libcommon/source/card_emu.c b/firmware/libcommon/source/card_emu.c index 4c29d414..5488fad7 100644 --- a/firmware/libcommon/source/card_emu.c +++ b/firmware/libcommon/source/card_emu.c @@ -453,7 +453,7 @@ static void card_set_state(struct card_handle *ch, * since the initial ETU is Fd=372/Dd=1 clock cycles long, we have to wait 2-107 ETU. */ tc_etu_set_wtime(ch->tc_chan, 2); - /* ensure the TC_ETU timer is enabled */ + /* enable the TC/ETU counter once reset has been released */ tc_etu_enable(ch->tc_chan); break; case ISO_S_IN_ATR: @@ -1129,8 +1129,6 @@ void card_emu_io_statechg(struct card_handle *ch, enum card_io io, int active) /* check end activation state (even if the reader does * not respect the activation sequence) */ if (ch->vcc_active && ch->clocked && !ch->in_reset) { - /* enable the TC/ETU counter once reset has been released */ - tc_etu_enable(ch->tc_chan); /* prepare to send the ATR */ card_set_state(ch, ISO_S_WAIT_ATR); }