From 2c955d7deb8a03d0d66b382f9dcf2834fd42b36a Mon Sep 17 00:00:00 2001 From: dxl <64101226@qq.com> Date: Sat, 19 Sep 2026 00:58:28 +0800 Subject: [PATCH] Fixed bug on the PM5 platform where changing PM3_CMD_DATA_SIZE to a larger value broke compatibility for certain commands. --- armsrc/BigBuf.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/armsrc/BigBuf.h b/armsrc/BigBuf.h index d588e9a22..43dfe66d8 100644 --- a/armsrc/BigBuf.h +++ b/armsrc/BigBuf.h @@ -20,6 +20,7 @@ #define __BIGBUF_H #include "common.h" +#include "pm3_cmd.h" #define MAX_FRAME_SIZE 256 // maximum allowed ISO14443 frame // The 14a demodulator stores 8 parity bits per 8 received bytes and then flushes @@ -50,6 +51,11 @@ // 8 data bits and 1 parity bit per payload byte, 1 correction bit, 1 SOC bit, 2 EOC bits #define TOSEND_BUFFER_SIZE (9 * MAX_FRAME_SIZE + 1 + 1 + 2) +// For double buffering, must be at least 2x PM3_CMD_DATA_SIZE +#if (PM3_CMD_DATA_SIZE * 2) > TOSEND_BUFFER_SIZE +#undef TOSEND_BUFFER_SIZE +#define TOSEND_BUFFER_SIZE (PM3_CMD_DATA_SIZE * 2) +#endif uint8_t *BigBuf_get_addr(void); uint32_t BigBuf_get_size(void);