summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartijn Coenen <maco@google.com>2016-07-22 12:18:20 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2016-07-22 12:18:20 +0000
commitd0c8ccb2664fdbe89c57c57f20a9fca5147fe605 (patch)
treec280b166fe4f1fb1b766943e04ec5c85b383f069
parent95dfb6957a472bb395d5b413877e34350eb9cd4a (diff)
parent7217c70249fac7b3852c0c3a428985e78cd416d4 (diff)
downloadlibnfc-nci-d0c8ccb2664fdbe89c57c57f20a9fca5147fe605.tar.gz
Merge "Fix the syncronization issue between read thread and write thread"
-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,