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.

This commit is contained in:
Marcello Morena 2013-07-09 18:42:10 +02:00 committed by Romuald Conty
parent bcd479a5d2
commit 98c4eee28f

View file

@ -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;