X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/95e635947bc4628b713fa00d7a533a881bca7fc4..24344f28ad0fd610da20436961a2b9d98238dc0d:/armsrc/util.c diff --git a/armsrc/util.c b/armsrc/util.c index b1ef6ea0..74fba94b 100644 --- a/armsrc/util.c +++ b/armsrc/util.c @@ -8,10 +8,11 @@ // Utility functions used in many places, not specific to any piece of code. //----------------------------------------------------------------------------- -#include "../include/proxmark3.h" +#include "proxmark3.h" #include "util.h" #include "string.h" #include "apps.h" +#include "BigBuf.h" @@ -34,7 +35,7 @@ void print_result(char *name, uint8_t *buf, size_t len) { } size_t nbytes(size_t nbits) { - return (nbits/8)+((nbits%8)>0); + return (nbits >> 3)+((nbits % 8) > 0); } uint32_t SwapBits(uint32_t value, int nrbits) { @@ -85,15 +86,6 @@ int32_t le24toh (uint8_t data[3]) return (data[2] << 16) | (data[1] << 8) | data[0]; } -//added here for parity calulations -uint8_t oddparity(uint8_t bt) -{ - uint16_t v = bt; - v ^= v >> 4; - v &= 0xF; - return ((0x9669 >> v) & 1); -} - void LEDsoff() { LED_A_OFF(); @@ -437,4 +429,3 @@ uint32_t RAMFUNC GetCountSspClk(){ } } -