mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-01-29 00:51:53 +08:00
spi firmware
This commit is contained in:
@@ -34,12 +34,12 @@ from . import aiotools
|
||||
|
||||
|
||||
# =====
|
||||
async def pulse(line: gpiod.Line, delay: float, final: float) -> None:
|
||||
async def pulse(line: gpiod.Line, delay: float, final: float, inverted: bool=False) -> None:
|
||||
try:
|
||||
line.set_value(1)
|
||||
line.set_value(int(not inverted))
|
||||
await asyncio.sleep(delay)
|
||||
finally:
|
||||
line.set_value(0)
|
||||
line.set_value(int(inverted))
|
||||
await asyncio.sleep(final)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user