X-Git-Url: http://cvs.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/a61b4976bd2085bf0495855b48fcad0d9ed4572e..02306bac2dc44bd1de5422f9db127b231cde304f:/armsrc/util.c diff --git a/armsrc/util.c b/armsrc/util.c index 0558fb94..b1ef6ea0 100644 --- a/armsrc/util.c +++ b/armsrc/util.c @@ -85,6 +85,15 @@ 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();