mirror of
https://github.com/nfc-tools/libnfc.git
synced 2026-02-27 04:06:38 +00:00
SPI: add 1ms sleep in wakeup()
Without this delay I had troubles with a Raspberry-Pi: With debug enabled I could go as high as 7.8MHz but without debug I had to go lower than 500kHz otherwise I got following error: errorlibnfc.driver.pn532_spiUnable to wait for SPI data. (RX) pn53x_check_communication: Timeout It could work occassionally faster but very unreliable. So the delay introduced by printf() was enough to "fix" the problem, therefore this little extra sleep() in wakeup().
This commit is contained in:
@@ -307,6 +307,7 @@ pn532_spi_wakeup(nfc_device *pnd)
|
||||
log_put(LOG_GROUP, LOG_CATEGORY, NFC_LOG_PRIORITY_DEBUG, "Got %x byte from SPI line before wakeup", spi_byte);
|
||||
|
||||
CHIP_DATA(pnd)->power_mode = NORMAL; // PN532 will be awake soon
|
||||
msleep(1);
|
||||
|
||||
if (spi_byte == 0xff) {
|
||||
log_put(LOG_GROUP, LOG_CATEGORY, NFC_LOG_PRIORITY_DEBUG, "%s", "Wakeup is needed");
|
||||
|
||||
Reference in New Issue
Block a user