mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2025-12-12 01:00:29 +08:00
fixed gpio context manager
This commit is contained in:
parent
5925957b96
commit
d9c0e62cec
@ -14,9 +14,11 @@ _logger = logging.getLogger(__name__)
|
||||
def bcm() -> Generator[None, None, None]:
|
||||
GPIO.setmode(GPIO.BCM)
|
||||
_logger.info("Configured GPIO mode as BCM")
|
||||
yield
|
||||
GPIO.cleanup()
|
||||
_logger.info("GPIO cleaned")
|
||||
try:
|
||||
yield
|
||||
finally:
|
||||
GPIO.cleanup()
|
||||
_logger.info("GPIO cleaned")
|
||||
|
||||
|
||||
def set_output_zeroed(pin: int) -> int:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user