From: sommersoft Date: Fri, 31 May 2019 23:20:31 +0000 (-0500) Subject: replace 'close()' with 'deinit()' X-Git-Tag: 1.3.4^2~3 X-Git-Url: https://git.ayoreis.com/Adafruit_Blinka-hackapet.git/commitdiff_plain/8fe9bc8bda76d6f0202ae5aacc7dab6d103f89fc?hp=--cc replace 'close()' with 'deinit()' --- 8fe9bc8bda76d6f0202ae5aacc7dab6d103f89fc diff --git a/src/adafruit_blinka/microcontroller/generic_linux/sysfs_pwmout.py b/src/adafruit_blinka/microcontroller/generic_linux/sysfs_pwmout.py index 4c975c3..de663e9 100644 --- a/src/adafruit_blinka/microcontroller/generic_linux/sysfs_pwmout.py +++ b/src/adafruit_blinka/microcontroller/generic_linux/sysfs_pwmout.py @@ -55,16 +55,13 @@ class PWMOut(object): self._open(pin, duty_cycle, frequency, variable_frequency) def __del__(self): - self.close() + self.deinit() def __enter__(self): return self def __exit__(self, t, value, traceback): - self.close() - - def deinit(self): - self.close() + self.deinit() def _open(self, pin, duty=0, freq=500, variable_frequency=False): self._channel = None @@ -107,8 +104,8 @@ class PWMOut(object): self._set_enabled(True) - def close(self): - """Close the sysfs PWM.""" + def deinit(self): + """Deinit the sysfs PWM.""" if self._channel is not None: self.duty_cycle = 0 try: