what was that doing there?

This commit is contained in:
Adeeb Shihadeh 2024-11-22 19:33:04 -08:00
parent cfbc3ff835
commit 5761ab58ea
1 changed files with 1 additions and 7 deletions

View File

@ -2,21 +2,15 @@
import os import os
import time import time
import subprocess import subprocess
import argparse
from panda import Panda, PandaDFU from panda import Panda, PandaDFU
board_path = os.path.dirname(os.path.realpath(__file__)) board_path = os.path.dirname(os.path.realpath(__file__))
if __name__ == "__main__": if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("--all", action="store_true", help="Recover all Panda devices")
args = parser.parse_args()
subprocess.check_call(f"scons -C {board_path}/.. -j$(nproc) {board_path}", shell=True) subprocess.check_call(f"scons -C {board_path}/.. -j$(nproc) {board_path}", shell=True)
serials = Panda.list() if args.all else [None] for s in Panda.list():
for s in serials:
with Panda(serial=s) as p: with Panda(serial=s) as p:
print(f"putting {p.get_usb_serial()} in DFU mode") print(f"putting {p.get_usb_serial()} in DFU mode")
p.reset(enter_bootstub=True) p.reset(enter_bootstub=True)