]> Repositories - hackapet/Adafruit_Blinka.git/blobdiff - src/digitalio.py
added i2c
[hackapet/Adafruit_Blinka.git] / src / digitalio.py
index a64a750ef90bc8b72a047fcba6a0013942295b6f..44034f94af590f1b80f78e9fc82a2169c16b6686 100755 (executable)
@@ -54,6 +54,7 @@ Pull.DOWN = Pull()
 
 #Pull.NONE = Pull()
 
+
 class DigitalInOut(ContextManaged):
     _pin = None
 
@@ -74,7 +75,10 @@ class DigitalInOut(ContextManaged):
         del self._pin
 
     def cleanup(self, channel=None):
-        Pin.cleanup(self, channel)
+        if channel == self:
+            Pin.cleanup(self._pin, self._pin)
+        else:
+            Pin.cleanup(self, channel)
 
     @property
     def direction(self):