]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - armsrc/BigBuf.c
CHG: some minor adjustments.
[proxmark3-svn] / armsrc / BigBuf.c
index 407133fdf60b5de431cfe05d6ab5dd523dfcf8a2..cf0c26b2b176c1dc8da7be8eab8fa19ab70520ed 100644 (file)
@@ -8,11 +8,7 @@
 //-----------------------------------------------------------------------------
 // BigBuf and functions to allocate/free parts of it.
 //-----------------------------------------------------------------------------
-
-#include <stdint.h>
-#include "proxmark3.h"
-#include "apps.h"
-#include "string.h"
+#include "BigBuf.h"
 
 // BigBuf is the large multi-purpose buffer, typically used to hold A/D samples or traces.
 // Also used to hold various smaller buffers and the Mifare Emulator Memory.
@@ -43,7 +39,6 @@ uint8_t *BigBuf_get_addr(void)
        return (uint8_t *)BigBuf;
 }
 
-
 // get the address of the emulator memory. Allocate part of Bigbuf for it, if not yet done
 uint8_t *BigBuf_get_EM_addr(void)
 {
@@ -54,18 +49,18 @@ uint8_t *BigBuf_get_EM_addr(void)
        return emulator_memory;
 }
 
-
 // clear ALL of BigBuf
 void BigBuf_Clear(void)
 {
        BigBuf_Clear_ext(true);
 }
+
 // clear ALL of BigBuf
 void BigBuf_Clear_ext(bool verbose)
 {
        memset(BigBuf, 0, BIGBUF_SIZE);
        if (verbose) 
-               Dbprintf("Buffer cleared (%i bytes)",BIGBUF_SIZE);
+               Dbprintf("Buffer cleared (%i bytes)", BIGBUF_SIZE);
 }
 
 void BigBuf_Clear_keep_EM(void)
@@ -86,7 +81,6 @@ uint8_t *BigBuf_malloc(uint16_t chunksize)
        }
 }
 
-
 // free ALL allocated chunks. The whole BigBuf is available for traces or samples again.
 void BigBuf_free(void)
 {
@@ -96,7 +90,6 @@ void BigBuf_free(void)
        // shouldn't this empty BigBuf also?
 }
 
-
 // free allocated chunks EXCEPT the emulator memory
 void BigBuf_free_keep_EM(void)
 {
@@ -146,7 +139,6 @@ uint16_t BigBuf_get_traceLen(void)
   The traces produced by calling this function can be fetched on the client-side
   by 'hf list raw', alternatively 'hf list <proto>' for protocol-specific
   annotation of commands/responses.
-
 **/
 bool RAMFUNC LogTrace(const uint8_t *btBytes, uint16_t iLen, uint32_t timestamp_start, uint32_t timestamp_end, uint8_t *parity, bool readerToTag)
 {
@@ -254,12 +246,10 @@ int LogTraceHitag(const uint8_t * btBytes, int iBits, int iSamples, uint32_t dwP
 // Emulator memory
 uint8_t emlSet(uint8_t *data, uint32_t offset, uint32_t length){
        uint8_t* mem = BigBuf_get_EM_addr();
-       if(offset+length < CARD_MEMORY_SIZE)
-       {
+       if(offset+length < CARD_MEMORY_SIZE) {
                memcpy(mem+offset, data, length);
                return 0;
-       }else
-       {
+       } else {
                Dbprintf("Error, trying to set memory outside of bounds! %d  > %d", (offset+length), CARD_MEMORY_SIZE);
                return 1;
        }
Impressum, Datenschutz