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,7 +14,9 @@ _logger = logging.getLogger(__name__)
|
|||||||
def bcm() -> Generator[None, None, None]:
|
def bcm() -> Generator[None, None, None]:
|
||||||
GPIO.setmode(GPIO.BCM)
|
GPIO.setmode(GPIO.BCM)
|
||||||
_logger.info("Configured GPIO mode as BCM")
|
_logger.info("Configured GPIO mode as BCM")
|
||||||
|
try:
|
||||||
yield
|
yield
|
||||||
|
finally:
|
||||||
GPIO.cleanup()
|
GPIO.cleanup()
|
||||||
_logger.info("GPIO cleaned")
|
_logger.info("GPIO cleaned")
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user