mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-08-08 01:35:40 +08:00
minor improvement
This commit is contained in:
@@ -348,11 +348,11 @@ def main():
|
||||
last_modified = None
|
||||
|
||||
while 1: #has_enabled_apps:
|
||||
if not init_done and sec_since_boot() - start_ts >= 10:
|
||||
init_apps(apps)
|
||||
init_done = True
|
||||
|
||||
if init_done:
|
||||
if not init_done:
|
||||
if sec_since_boot() - start_ts >= 10:
|
||||
init_apps(apps)
|
||||
init_done = True
|
||||
else:
|
||||
enabled_apps = []
|
||||
has_fullscreen_apps = False
|
||||
modified = dp_get_last_modified()
|
||||
@@ -435,7 +435,7 @@ def main():
|
||||
|
||||
last_started = started
|
||||
frame += 3
|
||||
time.sleep(3)
|
||||
time.sleep(3)
|
||||
|
||||
def system(cmd):
|
||||
try:
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
from common.params import Params, put_nonblocking
|
||||
import time
|
||||
from math import floor
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
default_conf = {
|
||||
'DragonEnableDashcam': '0',
|
||||
@@ -96,7 +98,15 @@ deprecated_conf_invert = {
|
||||
def dp_get_last_modified():
|
||||
return Params().get('DragonLastModified', encoding='utf-8')
|
||||
|
||||
def run_patcher():
|
||||
if os.path.isfile("/sdcard/dp_patcher.py"):
|
||||
try:
|
||||
subprocess.call(["python", "/sdcard/dp_patcher.py"])
|
||||
except subprocess.CalledProcessError as e:
|
||||
pass
|
||||
|
||||
def dragonpilot_set_params(params):
|
||||
run_patcher()
|
||||
# # remove deprecated params
|
||||
# for old, new in deprecated_conf.items():
|
||||
# if params.get(old) is not None:
|
||||
|
||||
Reference in New Issue
Block a user