Browse Source

Add emulation for AVR util/parity.h

main
PaulStoffregen 10 years ago
parent
commit
b98d2d6aaf
1 changed files with 13 additions and 0 deletions
  1. +13
    -0
      teensy3/util/parity.h

+ 13
- 0
teensy3/util/parity.h View File

@@ -0,0 +1,13 @@
#ifndef _UTIL_PARITY_H_
#define _UTIL_PARITY_H_

static inline uint8_t parity_even_bit(uint8_t x) __attribute__((pure, always_inline, unused));
static inline uint8_t parity_even_bit(uint8_t x)
{
x ^= x >> 1;
x ^= x >> 2;
x ^= x >> 4;
return x & 1;
}

#endif

Loading…
Cancel
Save