diff --git a/Firmware/Chameleon-Mini/Application/DESFire/DESFireISO14443Support.c b/Firmware/Chameleon-Mini/Application/DESFire/DESFireISO14443Support.c index 13452427..80043722 100644 --- a/Firmware/Chameleon-Mini/Application/DESFire/DESFireISO14443Support.c +++ b/Firmware/Chameleon-Mini/Application/DESFire/DESFireISO14443Support.c @@ -317,9 +317,8 @@ uint16_t ISO144433APiccProcess(uint8_t *Buffer, uint16_t BitCount) { back a response, so that we should not reset. */ decrementRetryCount = false; } else if (Cmd == ISO14443A_CMD_REQA || Cmd == ISO14443A_CMD_WUPA) { - ISO144433ASwitchState(ISO14443_3A_STATE_IDLE); - CheckStateRetryCount(true); ISO144434Reset(); + ISO144433ASwitchState(ISO14443_3A_STATE_READY1); decrementRetryCount = false; } else if (ISO144433AIsHalt(Buffer, BitCount)) { LogEntry(LOG_INFO_APP_CMD_HALT, NULL, 0); @@ -365,7 +364,7 @@ uint16_t ISO144433APiccProcess(uint8_t *Buffer, uint16_t BitCount) { return ISO14443A_ATQA_FRAME_SIZE_BYTES * BITS_PER_BYTE; case ISO14443_3A_STATE_READY1: - if (Cmd == ISO14443A_CMD_SELECT_CL1) { + if (Cmd == ISO14443A_CMD_SELECT_CL1 || Cmd == ISO14443A_CMD_REQA || Cmd == ISO14443A_CMD_WUPA) { /* Load UID CL1 and perform anticollision. */ ConfigurationUidType Uid; ApplicationGetUid(Uid); diff --git a/Firmware/Chameleon-Mini/Application/DESFire/DESFireISO14443Support.h b/Firmware/Chameleon-Mini/Application/DESFire/DESFireISO14443Support.h index 11be3e0a..b7c02096 100644 --- a/Firmware/Chameleon-Mini/Application/DESFire/DESFireISO14443Support.h +++ b/Firmware/Chameleon-Mini/Application/DESFire/DESFireISO14443Support.h @@ -114,8 +114,6 @@ extern uint8_t StateRetryCount; bool CheckStateRetryCount(bool resetByDefault); bool CheckStateRetryCount2(bool resetByDefault, bool performLogging); -//#define IGNORE_ACK_BYTE (0x92) - /* Support functions */ void ISO144434SwitchState(Iso144434StateType NewState); void ISO144434SwitchState2(Iso144434StateType NewState, bool performLogging); @@ -134,7 +132,6 @@ static uint16_t ISO144434ProcessBlock(uint8_t *Buffer, uint16_t ByteCount, uint1 fullReturnBits = ByteCount * BITS_PER_BYTE + ISO14443A_CRC_FRAME_SIZE; \ fullReturnBits; \ }) -/* TODO: Should we return CRC bytes when giving a NO_RESPONSE ??? ... Apparently "No". */ #define GetAndSetNoResponseCRCA(Buffer) ({ \ uint16_t fullReturnBits = 0; \ ISO14443AAppendCRCA(Buffer, 0); \