mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-09-30 19:33:45 +08:00
Agahnim
This commit is contained in:
@@ -67,9 +67,9 @@
|
||||
},
|
||||
{
|
||||
"name": "system",
|
||||
"url": "https://www.dropbox.com/scl/fi/1l949sdyse7mgiz2n09t7/system.img.xz?rlkey=63kws9ktx9pr9c7su2vgtf9xc&st=sm8qfkp3&dl=1",
|
||||
"hash": "d26f8e0f105a93ea0b386f259e1597d1cb10720cb6406491c570749e01d550c1",
|
||||
"hash_raw": "d26f8e0f105a93ea0b386f259e1597d1cb10720cb6406491c570749e01d550c1",
|
||||
"url": "https://www.dropbox.com/scl/fi/uglf3j1ne3pqtlx8j4mzp/system2.img.xz?rlkey=t1dp8rmyv6kuiyagy4p02ah6q&st=iai09tjz&dl=1",
|
||||
"hash": "06641f9fb602e6b046d1a619cc43dbaa724ff5c3700a32f1ef6677e40146359e",
|
||||
"hash_raw": "06641f9fb602e6b046d1a619cc43dbaa724ff5c3700a32f1ef6677e40146359e",
|
||||
"size": 5368709120,
|
||||
"sparse": false,
|
||||
"full_check": false,
|
||||
|
||||
+34
-5
@@ -1,14 +1,43 @@
|
||||
#!/usr/bin/env python3
|
||||
from pathlib import Path
|
||||
|
||||
from openpilot.system.hardware import HARDWARE
|
||||
import openpilot.system.ui.tici_updater as tici_updater
|
||||
import openpilot.system.ui.mici_updater as mici_updater
|
||||
|
||||
|
||||
def _framebuffer_size() -> tuple[int, int] | None:
|
||||
fb_path = Path("/sys/class/graphics/fb0/virtual_size")
|
||||
if not fb_path.is_file():
|
||||
return None
|
||||
|
||||
try:
|
||||
raw = fb_path.read_text().strip().replace(" ", "")
|
||||
width_s, height_s = raw.split(",", 1)
|
||||
return int(width_s), int(height_s)
|
||||
except Exception:
|
||||
return None
|
||||
|
||||
|
||||
def _ui_device_type() -> str:
|
||||
reported_type = HARDWARE.get_device_type()
|
||||
fb_size = _framebuffer_size()
|
||||
if fb_size is not None and max(fb_size) < 1000:
|
||||
return "mici"
|
||||
return reported_type
|
||||
|
||||
|
||||
def main():
|
||||
if HARDWARE.get_device_type() in ("tici", "tizi"):
|
||||
tici_updater.main()
|
||||
device_type = _ui_device_type()
|
||||
|
||||
# The updater stack imports application sizing during module import, so patch the
|
||||
# hardware probe before importing either UI implementation.
|
||||
HARDWARE.get_device_type = lambda: device_type
|
||||
|
||||
if device_type in ("tici", "tizi"):
|
||||
import openpilot.system.ui.tici_updater as updater_impl
|
||||
else:
|
||||
mici_updater.main()
|
||||
import openpilot.system.ui.mici_updater as updater_impl
|
||||
|
||||
updater_impl.main()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user