From 1952d275f713c2ad2671c3ac9bb3fb8eb44a93ef Mon Sep 17 00:00:00 2001 From: Guillermo Ruffino Date: Tue, 2 Feb 2021 20:30:20 -0300 Subject: [PATCH] RC522 increased retry loop count (#1506) --- esphome/components/rc522/rc522.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esphome/components/rc522/rc522.cpp b/esphome/components/rc522/rc522.cpp index ff8d18e3ea..8182c1e8c9 100644 --- a/esphome/components/rc522/rc522.cpp +++ b/esphome/components/rc522/rc522.cpp @@ -349,7 +349,7 @@ RC522::StatusCode RC522::pcd_communicate_with_picc_( // transmitting. Each iteration of the do-while-loop takes 17.86μs. // TODO check/modify for other architectures than Arduino Uno 16bit uint16_t i; - for (i = 4; i > 0; i--) { + for (i = 2000; i > 0; i--) { uint8_t n = pcd_read_register( COM_IRQ_REG); // ComIrqReg[7..0] bits are: Set1 TxIRq RxIRq IdleIRq HiAlertIRq LoAlertIRq ErrIRq TimerIRq if (n & wait_i_rq) { // One of the interrupts that signal success has been set.