refactoring

This commit is contained in:
Maxim Devaev
2024-09-18 04:37:43 +03:00
parent 45270a09d7
commit 7a53f14456
83 changed files with 517 additions and 516 deletions

View File

@@ -94,18 +94,18 @@ class Plugin(BaseUserGpioDriver):
pwm.period_ns = self.__period
pwm.duty_cycle_ns = self.__get_duty_cycle(bool(initial))
pwm.enable()
except Exception as err:
except Exception as ex:
logger.error("Can't get PWM chip %d channel %d: %s",
self.__chip, pin, tools.efmt(err))
self.__chip, pin, tools.efmt(ex))
async def cleanup(self) -> None:
for (pin, pwm) in self.__pwms.items():
try:
pwm.disable()
pwm.close()
except Exception as err:
except Exception as ex:
get_logger(0).error("Can't cleanup PWM chip %d channel %d: %s",
self.__chip, pin, tools.efmt(err))
self.__chip, pin, tools.efmt(ex))
async def read(self, pin: str) -> bool:
try: