From f049b568c5e52a0efcbf57ac161fda5b7c02a204 Mon Sep 17 00:00:00 2001 From: douniwan5788 Date: Wed, 23 Oct 2024 21:48:23 +0800 Subject: [PATCH] style --- armsrc/hitagS.c | 10 +++++----- client/src/cmdlf.c | 2 +- client/src/cmdlfhitaghts.c | 1 - common/commonutil.c | 1 + 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/armsrc/hitagS.c b/armsrc/hitagS.c index edee23a4de..0fda851b26 100644 --- a/armsrc/hitagS.c +++ b/armsrc/hitagS.c @@ -178,7 +178,7 @@ static void hitag_send_bit(int bit, bool ledcontrol) { while (AT91C_BASE_TC0->TC_CV < T0 * 32) {}; LOW(GPIO_SSC_DOUT); - while (AT91C_BASE_TC0->TC_CV < T0 * 64) {}; + while (AT91C_BASE_TC0->TC_CV < T0 * 64) {}; } else { // AC coding -_-_ @@ -310,7 +310,7 @@ static void hitag_reader_send_bit(int bit, bool ledcontrol) { if (ledcontrol) LED_A_ON(); // Reset clock for the next bit AT91C_BASE_TC0->TC_CCR = AT91C_TC_SWTRG; - while (AT91C_BASE_TC0->TC_CV != 0); + while (AT91C_BASE_TC0->TC_CV != 0) {}; // Binary puls length modulation (BPLM) is used to encode the data stream // This means that a transmission of a one takes longer than that of a zero @@ -355,7 +355,8 @@ static void hitag_reader_send_frame(const uint8_t *frame, size_t frame_len, bool } // send EOF AT91C_BASE_TC0->TC_CCR = AT91C_TC_SWTRG; - while (AT91C_BASE_TC0->TC_CV != 0); + while (AT91C_BASE_TC0->TC_CV != 0) {}; + HIGH(GPIO_SSC_DOUT); // Wait for 4-10 times the carrier period @@ -371,7 +372,6 @@ static void hts_stop_clock(void) { } static void hts_init_clock(void) { - // Enable Peripheral Clock for // Timer Counter 0, used to measure exact timing before answering // Timer Counter 1, used to capture edges of the tag frames @@ -407,7 +407,7 @@ static void hts_init_clock(void) { // synchronized startup procedure // In theory, with MCK/32, we shouldn't be waiting longer than 32 instruction statements, right? - while (AT91C_BASE_TC0->TC_CV != 0) {}; // wait until TC0 returned to zero + while (AT91C_BASE_TC0->TC_CV != 0) {}; // wait until TC0 returned to zero // reset timestamp timestamp_high = 0; diff --git a/client/src/cmdlf.c b/client/src/cmdlf.c index a5fd678c2a..af931d9d64 100644 --- a/client/src/cmdlf.c +++ b/client/src/cmdlf.c @@ -1588,7 +1588,7 @@ static bool check_chiptype(bool getDeviceData) { // Hitag S if (read_hts_uid() == PM3_SUCCESS) { - PrintAndLogEx(SUCCESS, "Chipset detection: " _GREEN_("Hitag S / 82xx")); + PrintAndLogEx(SUCCESS, "Chipset detection: " _GREEN_("Hitag 1/S / 82xx")); PrintAndLogEx(HINT, "Hint: try " _YELLOW_("`lf hitag hts`") " commands"); retval = true; goto out; diff --git a/client/src/cmdlfhitaghts.c b/client/src/cmdlfhitaghts.c index e72d7194f6..243af4a1a2 100644 --- a/client/src/cmdlfhitaghts.c +++ b/client/src/cmdlfhitaghts.c @@ -602,4 +602,3 @@ int CmdLFHitagS(const char *Cmd) { clearCommandBuffer(); return CmdsParse(CommandTable, Cmd); } - diff --git a/common/commonutil.c b/common/commonutil.c index 4c203a3322..495097aeee 100644 --- a/common/commonutil.c +++ b/common/commonutil.c @@ -544,6 +544,7 @@ void reverse_arraybytes_copy(uint8_t *arr, uint8_t *dest, size_t len) { } } +// TODO: consider overlap, Implement _membitmovebb size_t concatbits(uint8_t *dst, size_t dstskip, const uint8_t *src, size_t srcstart, size_t srclen) { // erase dstbuf bits that will be overriden dst[dstskip / 8] &= 0xFF - ((1 << (7 - (dstskip % 8) + 1)) - 1);