X-Git-Url: https://git.ayoreis.com/hackapet/Adafruit_Blinka.git/blobdiff_plain/3da8771ebabccdbcf5d26eb7242864211b7393a8..830fcdc5594f2ee5a191c96a643766e3232eeecb:/src/digitalio.py?ds=inline diff --git a/src/digitalio.py b/src/digitalio.py index a64a750..44034f9 100755 --- a/src/digitalio.py +++ b/src/digitalio.py @@ -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):