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:
parent
c8e50b6852
commit
f9bd5d79d2
1 changed files with 1 additions and 0 deletions
|
@ -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");
|
||||
|
|
Loading…
Add table
Reference in a new issue