|
@@ -36,42 +36,6 @@ ERROR_TAKES_ARGUMENTS = "{} takes {} {} argument(s): {}"
|
|
|
_pins_for_cleanup = set()
|
|
|
_gpio = None
|
|
|
|
|
|
-def _make_gpio_warpper():
|
|
|
- _gpio = GPIOWrapper()
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
class GPIOWrapper(object):
|
|
|
gpio = None
|
|
|
OUT = "out"
|
|
@@ -153,14 +117,14 @@ class GPIOWrapper(object):
|
|
|
if self.gpio:
|
|
|
self.gpio.setup(pins,value)
|
|
|
|
|
|
+_gpio = GPIOWrapper()
|
|
|
+
|
|
|
class PinBase(object):
|
|
|
"""PinBase is the base class for all classes representing a gpio pin"""
|
|
|
pin_number = None
|
|
|
value = None
|
|
|
def __init__(self,pin_number,mode):
|
|
|
super(PinBase,self).__init__()
|
|
|
- if _gpio == None:
|
|
|
- _make_gpio_warpper()
|
|
|
self.pin_number = pin_number
|
|
|
self.value = self.value_low
|
|
|
_gpio.setup(self.pin_number,_gpio.OUT)
|