-uint8_t parityTest(uint32_t bits, uint8_t bitLen, uint8_t pType) {
- uint8_t ans = 0;
- for (uint8_t i = 0; i < bitLen; i++){
- ans ^= ((bits >> i) & 1);
- }
- if (g_debugMode) prnt("DEBUG: ans: %d, ptype: %d, bits: %08X",ans,pType,bits);
- return (ans == pType);
+bool parityTest(uint32_t bits, uint8_t bitLen, uint8_t pType) {
+ return oddparity32(bits) ^ pType;