summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJizhou Liao <Jizhou.Liao@nxp.com>2016-05-31 10:21:02 -0700
committerMartijn Coenen <maco@google.com>2016-07-20 10:18:31 +0200
commit0e3eeae5ec8d7ea910407b81e2ba52abc9b84257 (patch)
tree81ec561899ea3c56881044680bcf20d0feaed337
parente1e11dc29f1a81d3039c0cfd395d3a1289fc2559 (diff)
downloadlibnfc-nci-0e3eeae5ec8d7ea910407b81e2ba52abc9b84257.tar.gz
NFC stack hang if Read Interrupt is notified even before the write callback is notified. Add 2ms delay to give priority to write thread if it is busy. Bug: 30240780 Change-Id: I732fd3c5412276d12f84103562997182b0e77aa1
-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,