fix various minor mistakes, ajust timeouts

This commit is contained in:
Romuald Conty 2012-01-10 14:10:44 +00:00
parent 1ec504e163
commit efa86f0e35
3 changed files with 4 additions and 4 deletions

View file

@ -273,7 +273,7 @@ select:
timeout_tv.tv_usec = ((timeout % 1000) * 1000); timeout_tv.tv_usec = ((timeout % 1000) * 1000);
} }
res = select (MAX(UART_DATA(sp)->fd, iAbortFd) + 1, &rfds, NULL, NULL, &timeout_tv); res = select (MAX(UART_DATA(sp)->fd, iAbortFd) + 1, &rfds, NULL, NULL, timeout ? &timeout_tv : NULL);
if ((res < 0) && (EINTR == errno)) { if ((res < 0) && (EINTR == errno)) {
// The system call was interupted by a signal and a signal handler was // The system call was interupted by a signal and a signal handler was
@ -283,7 +283,7 @@ select:
// Read error // Read error
if (res < 0) { if (res < 0) {
log_put (LOG_CATEGORY, NFC_PRIORITY_TRACE, "%s", "RX error."); log_put (LOG_CATEGORY, NFC_PRIORITY_TRACE, "Error: %s", strerror(errno));
return NFC_EIO; return NFC_EIO;
} }
// Read time-out // Read time-out

View file

@ -935,7 +935,7 @@ pn53x_check_communication (struct nfc_device *pnd)
if ((res = pn53x_transceive (pnd, abtCmd, sizeof (abtCmd), abtRx, szRx, 500)) < 0) if ((res = pn53x_transceive (pnd, abtCmd, sizeof (abtCmd), abtRx, szRx, 500)) < 0)
return res; return res;
szRx = (size_t) res; szRx = (size_t) res;
if (((sizeof(abtExpectedRx) == szRx) && (0 == memcmp (abtRx, abtExpectedRx, sizeof(abtExpectedRx)))) == 0) if ((sizeof(abtExpectedRx) == szRx) && (0 == memcmp (abtRx, abtExpectedRx, sizeof(abtExpectedRx))))
return NFC_SUCCESS; return NFC_SUCCESS;
return NFC_EIO; return NFC_EIO;

View file

@ -299,7 +299,7 @@ pn532_uart_send (nfc_device *pnd, const uint8_t *pbtData, const size_t szData, i
return res; return res;
} }
// According to PN532 application note, C106 appendix: to go out Low Vbat mode and enter in normal mode we need to send a SAMConfiguration command // According to PN532 application note, C106 appendix: to go out Low Vbat mode and enter in normal mode we need to send a SAMConfiguration command
if ((res = pn53x_SAMConfiguration (pnd, 0x01, 500)) < 0) { if ((res = pn53x_SAMConfiguration (pnd, 0x01, 1000)) < 0) {
return res; return res;
} }
} }