projects
/
saartuer.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
cleanup atexit
[saartuer.git]
/
ringd
diff --git
a/ringd
b/ringd
index 812043adb4ea914ca15a21c9c8ed70a7dc21ec28..3835d9c80e868e0f0b743d46faafc50a4d7fb31d 100755
(executable)
--- a/
ringd
+++ b/
ringd
@@
-1,5
+1,5
@@
#!/usr/bin/python3
#!/usr/bin/python3
-import time, socket
+import time, socket
, atexit
import RPi.GPIO as GPIO
tuerSock = "/run/tuer.sock"
import RPi.GPIO as GPIO
tuerSock = "/run/tuer.sock"
@@
-8,6
+8,7
@@
ringPin = 18
GPIO.setmode(GPIO.BOARD)
GPIO.setup(ringPin, GPIO.IN)
GPIO.setmode(GPIO.BOARD)
GPIO.setup(ringPin, GPIO.IN)
+atexit.register(GPIO.cleanup);
lastEvent = 0
lastEvent = 0
@@
-33,4
+34,4
@@
while True:
if data != b'1':
print("Received unexpected answer %s" % str(data))
if data != b'1':
print("Received unexpected answer %s" % str(data))
-GPIO.cleanup()
+