Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ classifiers = [
]
dependencies = [
"libusb1",
"opendbc @ git+https://github.com/sunnypilot/opendbc.git@master#egg=opendbc",
"opendbc @ git+https://github.com/sunnypilot/opendbc.git@master-tici#egg=opendbc",
]

[project.optional-dependencies]
Expand Down
10 changes: 5 additions & 5 deletions python/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,11 @@ class Panda:
HEALTH_STRUCT = struct.Struct("<IIIIIIIIBBBBBHBBBHfBBHBHHB")
CAN_HEALTH_STRUCT = struct.Struct("<BIBBBBBBBBIIIIIIIHHBBBIIII")

F4_DEVICES = [HW_TYPE_WHITE, HW_TYPE_BLACK, HW_TYPE_DOS, ]
H7_DEVICES = [HW_TYPE_RED_PANDA, HW_TYPE_TRES, HW_TYPE_CUATRO]
F4_DEVICES = [HW_TYPE_WHITE, HW_TYPE_BLACK, HW_TYPE_UNO, HW_TYPE_DOS]
H7_DEVICES = [HW_TYPE_RED_PANDA, HW_TYPE_RED_PANDA_V2, HW_TYPE_TRES, HW_TYPE_CUATRO]
SUPPORTED_DEVICES = F4_DEVICES + H7_DEVICES

INTERNAL_DEVICES = (HW_TYPE_DOS, HW_TYPE_TRES, HW_TYPE_CUATRO)
DEPRECATED_DEVICES = (HW_TYPE_WHITE, HW_TYPE_BLACK) + (HW_TYPE_GREY_PANDA, HW_TYPE_PEDAL, HW_TYPE_UNO, HW_TYPE_RED_PANDA_V2)

MAX_FAN_RPMs = {
HW_TYPE_DOS: 6500,
Expand Down Expand Up @@ -239,7 +239,7 @@ def connect(self, claim=True, wait=False):
logger.debug("connected")

hw_type = self.get_type()
if hw_type in Panda.DEPRECATED_DEVICES:
if hw_type not in self.SUPPORTED_DEVICES:
print("WARNING: Using deprecated HW")

# disable openpilot's heartbeat checks
Expand Down Expand Up @@ -473,7 +473,7 @@ def flash(self, fn=None, code=None, reconnect=True):
return

hw_type = self.get_type()
if hw_type in Panda.DEPRECATED_DEVICES:
if hw_type not in self.SUPPORTED_DEVICES:
raise RuntimeError(f"HW type {hw_type.hex()} is deprecated and can no longer be flashed.")

if not fn:
Expand Down
1 change: 1 addition & 0 deletions python/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def sector_address(self, i):
"bootstub.panda.bin",
)


H7Config = McuConfig(
"STM32H7",
0x483,
Expand Down
Loading