This commit is contained in:
1okko
2026-05-10 07:59:33 +08:00
parent 54e6124925
commit 5c0feefabd
482 changed files with 125673 additions and 6849 deletions
-8
View File
@@ -1,16 +1,10 @@
import os
import enum
import hashlib
from typing import NamedTuple
BASEDIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "../")
FW_PATH = os.path.join(BASEDIR, "board/obj/")
def compute_version_hash(filepath):
with open(filepath, "rb") as f:
# Normalize line endings on Windows
return int.from_bytes(hashlib.sha256(f.read().replace(b'\r', b'')).digest()[:4], 'little')
USBPACKET_MAX_SIZE = 0x40
class McuConfig(NamedTuple):
@@ -30,7 +24,6 @@ class McuConfig(NamedTuple):
# assume bootstub is in sector 0
return self.bootstub_address + sum(self.sector_sizes[:i])
F4Config = McuConfig(
"STM32F4",
0x463,
@@ -45,7 +38,6 @@ F4Config = McuConfig(
"bootstub.panda.bin",
)
H7Config = McuConfig(
"STM32H7",
0x483,