You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
888 B
33 lines
888 B
#!/usr/bin/env python3
|
|
import os
|
|
import pyray as rl
|
|
|
|
from openpilot.system.hardware import TICI
|
|
from openpilot.common.realtime import config_realtime_process, set_core_affinity
|
|
from openpilot.system.ui.lib.application import gui_app
|
|
from openpilot.selfdrive.ui.layouts.main import MainLayout
|
|
from openpilot.selfdrive.ui.ui_state import ui_state
|
|
|
|
|
|
def main():
|
|
cores = {5, }
|
|
config_realtime_process(0, 51)
|
|
|
|
gui_app.init_window("UI")
|
|
main_layout = MainLayout()
|
|
main_layout.set_rect(rl.Rectangle(0, 0, gui_app.width, gui_app.height))
|
|
for should_render in gui_app.render():
|
|
ui_state.update()
|
|
if should_render:
|
|
main_layout.render()
|
|
|
|
# reaffine after power save offlines our core
|
|
if TICI and os.sched_getaffinity(0) != cores:
|
|
try:
|
|
set_core_affinity(list(cores))
|
|
except OSError:
|
|
pass
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|
|
|