From 25932cafb7bd3927d3a1a82f59db073ff21925a5 Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Mon, 16 Jun 2025 00:03:32 +0200 Subject: [PATCH] iso14443a ManchesterDecoding: flush parity bits --- armsrc/iso14443a.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/armsrc/iso14443a.c b/armsrc/iso14443a.c index c22eb91c3..1764c44d3 100644 --- a/armsrc/iso14443a.c +++ b/armsrc/iso14443a.c @@ -596,6 +596,9 @@ void Demod14aInit(uint8_t *d, uint16_t n, uint8_t *par) { RAMFUNC int ManchesterDecoding(uint8_t bit, uint16_t offset, uint32_t non_real_time) { if (Demod.len == Demod.output_len) { + // Flush last parity bits + Demod.parityBits <<= (8 - (Demod.len & 0x0007)); // left align remaining parity bits + Demod.parity[Demod.parityLen++] = Demod.parityBits; // and store them return true; }