X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/2efd63948406db6dc65109c0cd5d79538acdd908..45293f1096a2fae3fbdad5f90248929cd9c6f562:/armsrc/pcf7931.c diff --git a/armsrc/pcf7931.c b/armsrc/pcf7931.c index 2b23bc36..4d45a69c 100644 --- a/armsrc/pcf7931.c +++ b/armsrc/pcf7931.c @@ -386,10 +386,9 @@ void WritePCF7931(uint8_t pass1, uint8_t pass2, uint8_t pass3, uint8_t pass4, ui */ void SendCmdPCF7931(uint32_t * tab){ - uint16_t u=0; - uint16_t tempo=0; + uint16_t u=0, tempo=0; - Dbprintf("SENDING DATA FRAME..."); + Dbprintf("Sending data frame..."); FpgaDownloadAndGo(FPGA_BITSTREAM_LF); @@ -413,27 +412,19 @@ void SendCmdPCF7931(uint32_t * tab){ tempo = AT91C_BASE_TC0->TC_CV; - for(u=0;tab[u]!= 0;u+=3){ - + for( u = 0; tab[u] != 0; u += 3){ // modulate antenna HIGH(GPIO_SSC_DOUT); - while(tempo != tab[u]){ - tempo = AT91C_BASE_TC0->TC_CV; - } + while(tempo != tab[u]) tempo = AT91C_BASE_TC0->TC_CV; // stop modulating antenna LOW(GPIO_SSC_DOUT); - while(tempo != tab[u+1]){ - tempo = AT91C_BASE_TC0->TC_CV; - } - + while(tempo != tab[u+1]) tempo = AT91C_BASE_TC0->TC_CV; // modulate antenna HIGH(GPIO_SSC_DOUT); - while(tempo != tab[u+2]){ - tempo = AT91C_BASE_TC0->TC_CV; - } + while(tempo != tab[u+2]) tempo = AT91C_BASE_TC0->TC_CV; } LED_A_OFF(); @@ -455,7 +446,7 @@ void SendCmdPCF7931(uint32_t * tab){ bool AddBytePCF7931(uint8_t byte, uint32_t * tab, int32_t l, int32_t p){ uint32_t u; - for (u=0; u<8; u++) + for ( u=0; u<8; u++) { if (byte&(1<