summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJizhou Liao <Jizhou.Liao@nxp.com>2016-07-22 12:22:39 +0000
committerandroid-build-merger <android-build-merger@google.com>2016-07-22 12:22:39 +0000
commita549a4317dd85d3b83eee579bcc085adbcf207cf (patch)
tree6036678602e7eafc298ee56bf5b3f9c5f9843d4a
parente8d29df1609b2b3cb5a233c879f4d18f41b2db02 (diff)
parentd0c8ccb2664fdbe89c57c57f20a9fca5147fe605 (diff)
downloadlibnfc-nci-a549a4317dd85d3b83eee579bcc085adbcf207cf.tar.gz
Merge \"Fix the syncronization issue between read thread and write thread\"
am: d0c8ccb266 Change-Id: I8d2a758c2404a1feb3c8b02c63fa1a1c69406e99
-rw-r--r--halimpl/pn54x/tml/phTmlNfc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/halimpl/pn54x/tml/phTmlNfc.c b/halimpl/pn54x/tml/phTmlNfc.c
index e50b49e..3d402df 100644
--- a/halimpl/pn54x/tml/phTmlNfc.c
+++ b/halimpl/pn54x/tml/phTmlNfc.c
@@ -394,6 +394,11 @@ static void phTmlNfc_TmlThread(void *pParam)
gpphTmlNfc_Context->bWriteCbInvoked = FALSE;
}
}
+ if (gpphTmlNfc_Context->tWriteInfo.bThreadBusy)
+ {
+ NXPLOG_TML_D ("Delay Read if write thread is busy");
+ usleep (2000); /*2ms delay to give prio to write complete */
+ }
/* Update the actual number of bytes read including header */
gpphTmlNfc_Context->tReadInfo.wLength = (uint16_t) (dwNoBytesWrRd);
phNxpNciHal_print_packet("RECV", gpphTmlNfc_Context->tReadInfo.pBuffer,