From 8d1dee8929c428045d9b50a56169280771b4d4af Mon Sep 17 00:00:00 2001 From: Andre Thomas Date: Sat, 5 Jan 2019 22:05:53 +0200 Subject: [PATCH] PN532: Enable 1ms ClockStretch Enable 1ms clock stretch as per datasheet Table 12.25 (Timing for the I2C interface) --- sonoff/xsns_40_pn532_i2c.ino | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sonoff/xsns_40_pn532_i2c.ino b/sonoff/xsns_40_pn532_i2c.ino index e41ba60ba..3c246a7d1 100644 --- a/sonoff/xsns_40_pn532_i2c.ino +++ b/sonoff/xsns_40_pn532_i2c.ino @@ -239,6 +239,8 @@ bool PN532_SAMConfig(void) void PN532_Detect(void) { if ((pn532_i2c_detected) || (pn532_i2c_disable)) { return; } + + Wire.setClockStretchLimit(1000); // Enable 1ms clock stretch as per datasheet Table 12.25 (Timing for the I2C interface) uint32_t ver = PN532_getFirmwareVersion(); if (ver) {