From 3613894c4e516d102e8d1ab3a68ca639eda36747 Mon Sep 17 00:00:00 2001 From: Ray Thomson Date: Sat, 6 Mar 2021 22:08:48 +1100 Subject: [PATCH] pylint fixes --- .../microcontroller/rockchip/PWMOut.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/adafruit_blinka/microcontroller/rockchip/PWMOut.py b/src/adafruit_blinka/microcontroller/rockchip/PWMOut.py index ae0f0ae..2065dc7 100644 --- a/src/adafruit_blinka/microcontroller/rockchip/PWMOut.py +++ b/src/adafruit_blinka/microcontroller/rockchip/PWMOut.py @@ -1,3 +1,9 @@ +""" +Much code from https://github.com/vsergeev/python-periphery/blob/master/periphery/pwm.py +Copyright (c) 2015-2016 vsergeev / Ivan (Vanya) A. Sergeev +License: MIT +""" + import os from time import sleep from errno import EACCES @@ -7,12 +13,16 @@ try: except ImportError: raise RuntimeError("No PWM outputs defined for this board.") from ImportError +# pylint: disable=unnecessary-pass + class PWMError(IOError): """Base class for PWM errors.""" pass +# pylint: enable=unnecessary-pass + class PWMOut: """Pulse Width Modulation Output Class""" @@ -83,6 +93,9 @@ class PWMOut: self._chip_path, self._channel_path.format(self._channel) ) + if variable_frequency: + print("Variable Frequency is not supported, continuing without it...") + if not os.path.isdir(self._chip_path): raise LookupError("Opening PWM: PWM chip {} not found.".format(self._chip)) @@ -163,11 +176,11 @@ class PWMOut: # Methods def enable(self): - """Enable the PWM outout.""" + """Enable the PWM output.""" self.enabled = True def disable(self): - """Diable the PWM output.""" + """Disable the PWM output.""" self.enabled = False # Mutable properties -- 2.49.0