diff options
author | Martijn Coenen <maco@google.com> | 2016-07-22 12:18:20 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2016-07-22 12:18:20 +0000 |
commit | d0c8ccb2664fdbe89c57c57f20a9fca5147fe605 (patch) | |
tree | c280b166fe4f1fb1b766943e04ec5c85b383f069 | |
parent | 95dfb6957a472bb395d5b413877e34350eb9cd4a (diff) | |
parent | 7217c70249fac7b3852c0c3a428985e78cd416d4 (diff) | |
download | libnfc-nci-d0c8ccb2664fdbe89c57c57f20a9fca5147fe605.tar.gz |
Merge "Fix the syncronization issue between read thread and write thread"
-rw-r--r-- | halimpl/pn54x/tml/phTmlNfc.c | 5 |
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, |