diff options
-rw-r--r-- | Linux_x86/phDal4Nfc_uart.c | 2 | ||||
-rwxr-xr-x[-rw-r--r--] | src/phDnldNfc.c | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/Linux_x86/phDal4Nfc_uart.c b/Linux_x86/phDal4Nfc_uart.c index 6c3a00f..bb891e3 100644 --- a/Linux_x86/phDal4Nfc_uart.c +++ b/Linux_x86/phDal4Nfc_uart.c @@ -287,7 +287,7 @@ int phDal4Nfc_uart_read(uint8_t * pBuffer, int nNbBytesToRead) FD_SET(gComPortContext.nHandle, &rfds); tv.tv_sec = 2; tv.tv_usec = 0; - ret = select(gComPortContext.nHandle + 1, &rfds, NULL, NULL, &tv); + ret = select(gComPortContext.nHandle + 1, &rfds, NULL, NULL, NULL); if (ret < 0) { DAL_DEBUG("select() errno=%d", errno); if (errno == EINTR || errno == EAGAIN) { diff --git a/src/phDnldNfc.c b/src/phDnldNfc.c index ba56513..904e3d4 100644..100755 --- a/src/phDnldNfc.c +++ b/src/phDnldNfc.c @@ -39,6 +39,7 @@ ################################################################################ */ #include <stdlib.h> +#include <unistd.h> #include <phNfcConfig.h> #include <phNfcCompId.h> #include <phNfcIoctlCode.h> @@ -2213,6 +2214,11 @@ phDnldNfc_Send_Complete ( { psDnldContext->resp_length = 0; psDnldContext->dnld_retry = 0; + /* clock unstable after SW reset command, especially on UART + * platform because of its sensitivity to clock. Experimentally + * we found clock unstable for 750us. Delay for 5ms to be sure. + */ + usleep(5000); status = phDnldNfc_Set_Seq(psDnldContext, DNLD_SEQ_UPDATE); } |