From 62216df450ab8fd0d2e23d3020a694fa1e4f0566 Mon Sep 17 00:00:00 2001 From: Samy Kamkar Date: Sat, 16 Jan 2021 12:07:52 -0800 Subject: [PATCH] Improve reliability of PN532 HSU --- libnfc/buses/uart.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libnfc/buses/uart.c b/libnfc/buses/uart.c index 0cff3f2..62f0f01 100644 --- a/libnfc/buses/uart.c +++ b/libnfc/buses/uart.c @@ -395,7 +395,11 @@ uart_send_single(serial_port sp, const uint8_t *pbtTx, const size_t szTx, int ti (void) timeout; int error = 0; for (int i = 0; i < szTx; i++) + { error |= uart_send(sp, pbtTx+i, 1, timeout); + usleep(9); + } + return error ? NFC_EIO : NFC_SUCCESS; }