Lint more python scripts

This commit is contained in:
Matt Mets 2023-03-02 23:52:52 +01:00 committed by Michael Cardell Widerkrantz
parent 49c3b35a4b
commit d09919d354
No known key found for this signature in database
GPG key ID: D3DB3DDF57E704E5
3 changed files with 70 additions and 50 deletions

View file

@ -1,16 +1,20 @@
#!/usr/bin/env python
import hid_test
import hid_test # type: ignore
import time
def reset_tk1():
"""Manipulate the GPIO lines on the MTA1-USB-CH552 Programmer to issue a
hardware reset to the TK1. The result is that TK1 again will be in firmware
mode, so a new app can be loaded."""
def reset_tk1() -> None:
""" Reset a TK1 contained in a TP1 programmer
Manipulate the GPIO lines on the TP1 to issue a hardware reset
to the TK1. The result is that TK1 again will be in firmware
mode, so a new app can be loaded.
"""
d = hid_test.ice40_flasher()
d.gpio_set_direction(14, True)
d.gpio_put(14, False)
d.gpio_set_direction(14, False)
d.close()
reset_tk1()