mirror of
https://github.com/infiniteCable2/panda.git
synced 2026-02-19 01:33:52 +08:00
* cleanup is_enumerated, rename comms and init spi * big comms refactor, building now * misra fixes * more fixes * misra try 3 * cleanup * this belongs in a separate PR * remove unneccesary file * revert llspi changes * llspi misra fix * enable SPI on F4 and setup gpio * duh * wip: spi comms * more spi wip * dynamic sector erasing * Revert "dynamic sector erasing" This reverts commit fce1215a2ede45e5e2a0e97ca23a86c1d8bfa94a. * more sectors to be erased * debugging * woah, this works * cleanup on the panda side * add sync and checksum checks, and fix recovery on errors * this seems relatively stable * add retrying * this is stabler * some endianness and endpoint fixes * builds * revert that * add that back * checksum start * start splitting up driver * spi behind flag * cleanup test * bump up timeout Co-authored-by: Comma Device <device@comma.ai> Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
24 lines
405 B
Python
Executable File
24 lines
405 B
Python
Executable File
#!/usr/bin/env python3
|
|
import os
|
|
import time
|
|
from panda import Panda
|
|
|
|
if __name__ == "__main__":
|
|
spi = "SPI" in os.environ
|
|
print("using SPI" if spi else "using USB")
|
|
|
|
|
|
i = 0
|
|
pi = 0
|
|
|
|
panda = Panda(spi=spi)
|
|
while True:
|
|
st = time.monotonic()
|
|
while time.monotonic() - st < 1:
|
|
panda.health()
|
|
i += 1
|
|
print(i, panda.health(), "\n")
|
|
print(f"Speed: {i - pi}Hz")
|
|
pi = i
|
|
|