summaryrefslogtreecommitdiffstats
path: root/Linux_x86
diff options
context:
space:
mode:
authorNick Pelly <npelly@google.com>2010-11-03 14:59:20 -0500
committerNick Pelly <npelly@google.com>2010-11-03 15:04:37 -0500
commit52ffcd90d9da60151c4343bc25f272da65cf6b98 (patch)
treeb4f5274648a06e37ddad55f913b144e4569cf725 /Linux_x86
parente1b8bffcf9ff1a5c290c03be5a1d85be0c103223 (diff)
downloadexternal_libnfc-nxp-52ffcd90d9da60151c4343bc25f272da65cf6b98.zip
external_libnfc-nxp-52ffcd90d9da60151c4343bc25f272da65cf6b98.tar.gz
external_libnfc-nxp-52ffcd90d9da60151c4343bc25f272da65cf6b98.tar.bz2
Increase hardware reset time.
VEN was pulled low for 7ms, as per data sheet, but pn544 not awlays reset. Increase time. Change-Id: I7de9e4fc94a0493605f706505962bdfab9d03666 Signed-off-by: Nick Pelly <npelly@google.com>
Diffstat (limited to 'Linux_x86')
-rw-r--r--Linux_x86/phDal4Nfc_i2c.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/Linux_x86/phDal4Nfc_i2c.c b/Linux_x86/phDal4Nfc_i2c.c
index 5e0b30b..4f18ffc 100644
--- a/Linux_x86/phDal4Nfc_i2c.c
+++ b/Linux_x86/phDal4Nfc_i2c.c
@@ -22,6 +22,9 @@
*
*/
+#define LOG_TAG "NFC_i2c"
+#include <utils/Log.h>
+
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
@@ -244,6 +247,16 @@ int phDal4Nfc_i2c_reset(long level)
ret = ioctl(gI2cPortContext.nHandle, PN544_SET_PWR, level);
+ /* HACK to increase reset time
+ * TODO: move this to kernel
+ */
+ if (level == 0) {
+ LOGW("sleeping a little longer...");
+ usleep(10000);
+ } else {
+ usleep(10000);
+ }
+
return ret;
}