Skip to content

Commit f447d94

Browse files
authored
Merge pull request ondryaso#28 from mileippert/master
Added ability to ignore reset pin to init method.
2 parents d170a6f + a5b7e6f commit f447d94

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pirc522/rfid.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,12 @@ def __init__(self, bus=0, device=0, speed=1000000, pin_rst=22,
4848
self.spi.max_speed_hz = speed
4949

5050
GPIO.setmode(pin_mode)
51-
GPIO.setup(pin_rst, GPIO.OUT)
51+
if pin_rst != 0:
52+
GPIO.setup(pin_rst, GPIO.OUT)
53+
GPIO.output(pin_rst, 1)
5254
GPIO.setup(pin_irq, GPIO.IN, pull_up_down=GPIO.PUD_UP)
5355
GPIO.add_event_detect(pin_irq, GPIO.FALLING,
5456
callback=self.irq_callback)
55-
GPIO.output(pin_rst, 1)
5657
if pin_ce != 0:
5758
GPIO.setup(pin_ce, GPIO.OUT)
5859
GPIO.output(pin_ce, 1)

0 commit comments

Comments
 (0)