mirror of
https://github.com/infiniteCable2/panda.git
synced 2026-02-19 01:33:52 +08:00
Merge branch 'master' of https://github.com/sunnypilot/panda
This commit is contained in:
@@ -125,6 +125,7 @@ class Panda:
|
||||
HEALTH_STRUCT = struct.Struct("<IIIIIIIIBBBBBHBBBHfBBHHHB")
|
||||
CAN_HEALTH_STRUCT = struct.Struct("<BIBBBBBBBBIIIIIIIHHBBBIIII")
|
||||
|
||||
F4_DEVICES = [HW_TYPE_WHITE, HW_TYPE_BLACK]
|
||||
H7_DEVICES = [HW_TYPE_RED_PANDA, HW_TYPE_TRES, HW_TYPE_CUATRO]
|
||||
SUPPORTED_DEVICES = H7_DEVICES
|
||||
|
||||
@@ -632,7 +633,9 @@ class Panda:
|
||||
|
||||
def get_mcu_type(self) -> McuType:
|
||||
hw_type = self.get_type()
|
||||
if hw_type in Panda.H7_DEVICES:
|
||||
if hw_type in Panda.F4_DEVICES:
|
||||
return McuType.F4
|
||||
elif hw_type in Panda.H7_DEVICES:
|
||||
return McuType.H7
|
||||
raise ValueError(f"unknown HW type: {hw_type}")
|
||||
|
||||
|
||||
@@ -25,6 +25,21 @@ class McuConfig(NamedTuple):
|
||||
return self.bootstub_address + sum(self.sector_sizes[:i])
|
||||
|
||||
|
||||
F4Config = McuConfig(
|
||||
"STM32F4",
|
||||
0x463,
|
||||
[0x4000 for _ in range(4)] + [0x10000] + [0x20000 for _ in range(11)],
|
||||
16,
|
||||
0x1FFF7A10,
|
||||
0x800,
|
||||
0x1FFF79C0,
|
||||
0x8004000,
|
||||
"panda.bin.signed",
|
||||
0x8000000,
|
||||
"bootstub.panda.bin",
|
||||
)
|
||||
|
||||
|
||||
H7Config = McuConfig(
|
||||
"STM32H7",
|
||||
0x483,
|
||||
@@ -42,6 +57,7 @@ H7Config = McuConfig(
|
||||
|
||||
@enum.unique
|
||||
class McuType(enum.Enum):
|
||||
F4 = F4Config
|
||||
H7 = H7Config
|
||||
|
||||
@property
|
||||
|
||||
Reference in New Issue
Block a user