From bdaa95484c2e379482c3d24104888a8badde2d50 Mon Sep 17 00:00:00 2001 From: Christina Quast Date: Mon, 6 Apr 2015 00:52:08 +0200 Subject: [PATCH] Bug fix: Fix endless loop when ATR is not received Without this fix, if the host software does not send an ATR, simtrace waits for this answer in an endless loop of unsuccessfull USB endpoint write attempts. --- sam3s_example/simtrace/phone.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sam3s_example/simtrace/phone.c b/sam3s_example/simtrace/phone.c index 8c84be72..ec50d68c 100644 --- a/sam3s_example/simtrace/phone.c +++ b/sam3s_example/simtrace/phone.c @@ -152,7 +152,7 @@ static void ISR_PhoneRST( const Pin *pPin) */ // FIXME: What to do on reset? // FIXME: It seems like the phone is constantly sending a lot of these RSTs -// PIO_DisableIt( &pinPhoneRST ) ; + PIO_DisableIt( &pinPhoneRST ) ; } static void Config_PhoneRST_IrqHandler() @@ -301,6 +301,7 @@ void send_ATR(uint8_t *ATR, uint8_t status, uint32_t transferred, uint32_t remai _ISO7816_SendChar(*(ATR++)); } state = WAIT_CMD_PHONE; + PIO_EnableIt( &pinPhoneRST ) ; } void sendResponse( uint8_t *pArg, uint8_t status, uint32_t transferred, uint32_t remaining)