summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Pelly <npelly@google.com>2011-10-26 08:07:54 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2011-10-26 08:07:54 -0700
commit1fd31d6a2b28559c60e8d79c3bd369fca663f133 (patch)
tree09523ff87feb3ef06c5f13264597576d4eff3070
parent49bcf5f81432e7b0ef0f28dbfe0e10319fd6e9da (diff)
parentb13b27aa9bb96897e996cf89ed8412c46ef2cf07 (diff)
downloadexternal_libnfc-nxp-1fd31d6a2b28559c60e8d79c3bd369fca663f133.zip
external_libnfc-nxp-1fd31d6a2b28559c60e8d79c3bd369fca663f133.tar.gz
external_libnfc-nxp-1fd31d6a2b28559c60e8d79c3bd369fca663f133.tar.bz2
am b13b27aa: Use a 10s timeout in uart_read() in FW download mode.
* commit 'b13b27aa9bb96897e996cf89ed8412c46ef2cf07': Use a 10s timeout in uart_read() in FW download mode.
-rw-r--r--Linux_x86/phDal4Nfc_uart.c6
-rw-r--r--inc/phNfcConfig.h2
2 files changed, 6 insertions, 2 deletions
diff --git a/Linux_x86/phDal4Nfc_uart.c b/Linux_x86/phDal4Nfc_uart.c
index 7ff9c4c..a2f6db3 100644
--- a/Linux_x86/phDal4Nfc_uart.c
+++ b/Linux_x86/phDal4Nfc_uart.c
@@ -342,7 +342,7 @@ int phDal4Nfc_uart_read(uint8_t * pBuffer, int nNbBytesToRead)
read_property();
// Read timeout:
- // FW mode: no timeout
+ // FW mode: 10s timeout
// 1 byte read: steady-state LLC length read, allowed to block forever
// >1 byte read: LLC payload, 100ms timeout (before pn544 re-transmit)
if (nNbBytesToRead > 1 && !libnfc_firmware_mode) {
@@ -353,6 +353,10 @@ int phDal4Nfc_uart_read(uint8_t * pBuffer, int nNbBytesToRead)
timeout.tv_nsec -= 1000000000;
}
ptv = &tv;
+ } else if (libnfc_firmware_mode) {
+ clock_gettime(CLOCK_MONOTONIC, &timeout);
+ timeout.tv_sec += 10;
+ ptv = &tv;
} else {
ptv = NULL;
}
diff --git a/inc/phNfcConfig.h b/inc/phNfcConfig.h
index bcefaec..cced2ca 100644
--- a/inc/phNfcConfig.h
+++ b/inc/phNfcConfig.h
@@ -235,7 +235,7 @@
#ifndef NXP_DNLD_COMPLETE_TIMEOUT
-#define NXP_DNLD_COMPLETE_TIMEOUT 120000U
+#define NXP_DNLD_COMPLETE_TIMEOUT 60000U
#endif