From 98c4eee28f3dda31639685c0d50c57e27f4acab1 Mon Sep 17 00:00:00 2001 From: Marcello Morena Date: Tue, 9 Jul 2013 18:42:10 +0200 Subject: [PATCH] Modified the preamble sent to PN532 via UART from 5 bytes to 16 bytes, to comply with PN532 manual that says to send a "large" preamble in order to wake up the PN532. This is done to solve wakeup timeout problems on some PN532 Breakout Boards. --- libnfc/drivers/pn532_uart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libnfc/drivers/pn532_uart.c b/libnfc/drivers/pn532_uart.c index 09a75a4..0e1c0d5 100644 --- a/libnfc/drivers/pn532_uart.c +++ b/libnfc/drivers/pn532_uart.c @@ -283,7 +283,7 @@ int pn532_uart_wakeup(nfc_device *pnd) { /* High Speed Unit (HSU) wake up consist to send 0x55 and wait a "long" delay for PN532 being wakeup. */ - const uint8_t pn532_wakeup_preamble[] = { 0x55, 0x55, 0x00, 0x00, 0x00 }; + const uint8_t pn532_wakeup_preamble[] = { 0x55, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; int res = uart_send(DRIVER_DATA(pnd)->port, pn532_wakeup_preamble, sizeof(pn532_wakeup_preamble), 0); CHIP_DATA(pnd)->power_mode = NORMAL; // PN532 should now be awake return res;