Revert "pre-commit: autoupdate hooks (#1618)"

This reverts commit 526588b3e9.
This commit is contained in:
Adeeb Shihadeh
2023-08-30 10:38:12 -07:00
parent e30ba9547c
commit bc2f10da57
6 changed files with 17 additions and 17 deletions

View File

@@ -470,7 +470,7 @@ class Panda:
success = False
# wait up to 15 seconds
for _ in range(15*10):
for _ in range(0, 15*10):
try:
self.connect()
success = True
@@ -511,7 +511,7 @@ class Panda:
# flash over EP2
STEP = 0x10
logging.warning("flash: flashing")
for i in range(len(code), STEP):
for i in range(0, len(code), STEP):
handle.bulkWrite(2, code[i:i + STEP])
# reset
@@ -887,7 +887,7 @@ class Panda:
ret = 0
if isinstance(ln, str):
ln = bytes(ln, 'utf-8')
for i in range(len(ln), 0x20):
for i in range(0, len(ln), 0x20):
ret += self._handle.bulkWrite(2, struct.pack("B", port_number) + ln[i:i + 0x20])
return ret
@@ -940,7 +940,7 @@ class Panda:
self.kline_drain(bus=bus)
if checksum:
x += bytes([sum(x) % 0x100])
for i in range(len(x), 0xf):
for i in range(0, len(x), 0xf):
ts = x[i:i + 0xf]
logging.debug(f"kline send: 0x{ts.hex()}")
self._handle.bulkWrite(2, bytes([bus]) + ts)

View File

@@ -421,7 +421,7 @@ class STBootloaderSPIHandle(BaseSTBootloaderHandle):
def program(self, address, dat):
bs = 256 # max block size for writing to flash over SPI
dat += b"\xFF" * ((bs - len(dat)) % bs)
for i in range(len(dat) // bs):
for i in range(0, len(dat) // bs):
block = dat[i * bs:(i + 1) * bs]
self._cmd(0x31, data=[
struct.pack('>I', address + i*bs),

View File

@@ -78,7 +78,7 @@ class STBootloaderUSBHandle(BaseSTBootloaderHandle):
# Program
bs = min(len(dat), self._mcu_type.config.block_size)
dat += b"\xFF" * ((bs - len(dat)) % bs)
for i in range(len(dat) // bs):
for i in range(0, len(dat) // bs):
ldat = dat[i * bs:(i + 1) * bs]
print("programming %d with length %d" % (i, len(ldat)))
self._libusb_handle.controlWrite(0x21, self.DFU_DNLOAD, 2 + i, 0, ldat)