minor improvement

This commit is contained in:
Rick Lan
2020-04-09 17:15:35 +10:00
parent a49d86eea6
commit d4dea69c43
2 changed files with 16 additions and 6 deletions
+6 -6
View File
@@ -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: