From a4069fe2aa78f8008bc93165e1107057154b50d9 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Sat, 11 Nov 2017 22:34:34 +0100 Subject: [PATCH] chg: code cleaning --- armsrc/hitag2.c | 11 ++++------- armsrc/hitagS.c | 1 - 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/armsrc/hitag2.c b/armsrc/hitag2.c index b47125175..54570945f 100644 --- a/armsrc/hitag2.c +++ b/armsrc/hitag2.c @@ -684,14 +684,14 @@ static bool hitag2_authenticate(byte_t* rx, const size_t rxlen, byte_t* tx, size return false; } *txlen = 5; - memcpy(tx,"\xc0",nbytes(*txlen)); + memcpy(tx,"\xc0", nbytes(*txlen)); } break; // Received UID, crypto tag answer case 32: { if (!bCrypto) { *txlen = 64; - memcpy(tx,NrAr,8); + memcpy(tx, NrAr, 8); bCrypto = true; } else { DbpString("Authentication succesful!"); @@ -701,7 +701,7 @@ static bool hitag2_authenticate(byte_t* rx, const size_t rxlen, byte_t* tx, size // Unexpected response default: { - Dbprintf("Uknown frame length: %d",rxlen); + Dbprintf("Uknown frame length: %d", rxlen); return false; } break; } @@ -863,7 +863,7 @@ void SnoopHitag(uint32_t type) { AT91C_BASE_TC1->TC_CCR = AT91C_TC_CLKEN | AT91C_TC_SWTRG; // Reset the received frame, frame count and timing info - memset(rx,0x00,sizeof(rx)); + memset(rx, 0x00, sizeof(rx)); frame_count = 0; response = 0; overflow = 0; @@ -1452,9 +1452,6 @@ void ReaderHitag(hitag_function htf, hitag_data* htd) { // Capture tag frame (manchester decoding using only falling edges) if (ra >= HITAG_T_EOF) { - if (rxlen != 0) { - //DbpString("wierd1?"); - } // Capture the T0 periods that have passed since last communication or field drop (reset) // We always recieve a 'one' first, which has the falling edge after a half period |-_| response = ra-HITAG_T_TAG_HALF_PERIOD; diff --git a/armsrc/hitagS.c b/armsrc/hitagS.c index ee4dc7d61..4502f93b7 100644 --- a/armsrc/hitagS.c +++ b/armsrc/hitagS.c @@ -962,7 +962,6 @@ void SimulateHitagSTag(bool tag_mem_supplied, byte_t* data) { tag.pstate = HT_READY; tag.tstate = HT_NO_OP; - tag.tstate = HT_NO_OP; for (i = 0; i < 16; i++) for (j = 0; j < 4; j++) tag.pages[i][j] = 0x0;