mxgxw / MFRC522-python

A small class to interface with the NFC reader Module MFRC522
GNU Lesser General Public License v3.0
521 stars 419 forks source link

Syntax error in MFRC522.py causing a massive slowdown #90

Open jah0383 opened 3 years ago

jah0383 commented 3 years ago

In MFRC522.py on line 199 the code is if ~((i!=0) and ~(n&0x01) and ~(n&waitIRq)): It should use not instead of ~ since at the moment the entire loop only exits when done 2000 times, which takes 1.6 seconds replacing the ~'s with not's creates a massive speed up. So the line should be if not ((i != 0) and not (n & 0x01) and not (n & waitIRq)):