mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-02-23 17:13:51 +08:00
dragonpilot beta3
date: 2023-08-14T18:35:32 commit: 90b4f6596bf852f4add5a8faa7581aabb57e4ba4
This commit is contained in:
@@ -7,7 +7,6 @@ import struct
|
||||
import hashlib
|
||||
import binascii
|
||||
import datetime
|
||||
import warnings
|
||||
import logging
|
||||
from functools import wraps
|
||||
from typing import Optional
|
||||
@@ -425,10 +424,10 @@ class Panda:
|
||||
if device.getVendorID() == 0xbbaa and device.getProductID() in cls.USB_PIDS:
|
||||
try:
|
||||
serial = device.getSerialNumber()
|
||||
if len(serial) == 24:
|
||||
if len(serial) == 24 or serial == "pedal":
|
||||
ret.append(serial)
|
||||
else:
|
||||
warnings.warn(f"found device with panda descriptors but invalid serial: {serial}", RuntimeWarning)
|
||||
logging.warning(f"found device with panda descriptors but invalid serial: {serial}", RuntimeWarning)
|
||||
except Exception:
|
||||
continue
|
||||
except Exception:
|
||||
@@ -474,11 +473,7 @@ class Panda:
|
||||
success = True
|
||||
break
|
||||
except Exception:
|
||||
try:
|
||||
dfu = PandaDFU(self.get_dfu_serial())
|
||||
dfu.recover()
|
||||
except Exception:
|
||||
pass
|
||||
pass
|
||||
time.sleep(0.1)
|
||||
if not success:
|
||||
raise Exception("reconnect failed")
|
||||
@@ -772,13 +767,6 @@ class Panda:
|
||||
def enable_deepsleep(self):
|
||||
self._handle.controlWrite(Panda.REQUEST_OUT, 0xfb, 0, 0, b'')
|
||||
|
||||
def set_esp_power(self, on):
|
||||
self._handle.controlWrite(Panda.REQUEST_OUT, 0xd9, int(on), 0, b'')
|
||||
|
||||
def esp_reset(self, bootmode=0):
|
||||
self._handle.controlWrite(Panda.REQUEST_OUT, 0xda, int(bootmode), 0, b'')
|
||||
time.sleep(0.2)
|
||||
|
||||
def set_safety_mode(self, mode=SAFETY_SILENT, param=0):
|
||||
self._handle.controlWrite(Panda.REQUEST_OUT, 0xdc, mode, param, b'')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user