summaryrefslogtreecommitdiffstats
path: root/Linux_x86
diff options
context:
space:
mode:
authordaniel_Tomas <daniel.tomas@trusted-logic.com>2010-12-03 14:16:11 +0100
committerNick Pelly <npelly@google.com>2010-12-05 18:33:55 -0800
commit73fcd52e49db49449613035a3bce8b04d9890f72 (patch)
tree8f6fcd315a672af3a5910446cacc76a9cb64938c /Linux_x86
parent143acf0b768ce3c2f61de2add5ca339479defd57 (diff)
downloadexternal_libnfc-nxp-73fcd52e49db49449613035a3bce8b04d9890f72.zip
external_libnfc-nxp-73fcd52e49db49449613035a3bce8b04d9890f72.tar.gz
external_libnfc-nxp-73fcd52e49db49449613035a3bce8b04d9890f72.tar.bz2
Fix to increase the stability of the Init/Deint action
Change-Id: I89e08ab079a6c0a83cd5a128ecfee2026411af15
Diffstat (limited to 'Linux_x86')
-rw-r--r--Linux_x86/phDal4Nfc.c13
-rw-r--r--Linux_x86/phDal4Nfc_i2c.c2
2 files changed, 12 insertions, 3 deletions
diff --git a/Linux_x86/phDal4Nfc.c b/Linux_x86/phDal4Nfc.c
index 97217f9..4cc2470 100644
--- a/Linux_x86/phDal4Nfc.c
+++ b/Linux_x86/phDal4Nfc.c
@@ -289,6 +289,9 @@ NFCSTATUS phDal4Nfc_ConfigRelease( void *pHwRef)
DAL_PRINT("phDal4Nfc_ConfigRelease ");
+ /* Shutdown NFC Chip */
+ phDal4Nfc_Reset(0);
+
if (gDalContext.hw_valid == TRUE)
{
/* Kill the read and write threads */
@@ -475,8 +478,14 @@ PURPOSE: Cancel the Read wait function.
NFCSTATUS phDal4Nfc_ReadWaitCancel( void *pContext, void *pHwRef)
{
- /* not used */
- DAL_PRINT("phDal4Nfc_ReadWaitCancel");
+ DAL_PRINT("phDal4Nfc_ReadWaitCancel");
+
+ /* unlock read semaphore */
+ sem_post(&nfc_read_sem);
+
+ /* Stop the reader thread */
+ gReadWriteContext.nReadThreadAlive = 0;
+
return 0;
}
diff --git a/Linux_x86/phDal4Nfc_i2c.c b/Linux_x86/phDal4Nfc_i2c.c
index 4f18ffc..667c1a0 100644
--- a/Linux_x86/phDal4Nfc_i2c.c
+++ b/Linux_x86/phDal4Nfc_i2c.c
@@ -252,7 +252,7 @@ int phDal4Nfc_i2c_reset(long level)
*/
if (level == 0) {
LOGW("sleeping a little longer...");
- usleep(10000);
+ usleep(50000);
} else {
usleep(10000);
}