Mask facilityCode and cardCode, just for safety

doesn't matter with their current types, but it doesn't really hurt either
This commit is contained in:
Adam Goldsmith 2020-03-28 17:11:24 -04:00
parent c7d0b6b747
commit 1322667762

View File

@ -71,8 +71,8 @@ void loop()
// P: parity bit, F: facility code, C: card code
// PFFFFFFFFCCCCCCCCCCCCCCCCP
if (bitCount == 26) {
uint8_t facilityCode = (data >> 17);
uint16_t cardCode = (data >> 1);
uint8_t facilityCode = (data >> 17) & 0xFF;
uint16_t cardCode = (data >> 1) & 0xFFFF;
// TODO: check parity bits
Keyboard.print(facilityCode);