mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-06-13 07:24:34 +08:00
Merge branch 'dragonpilot-dev' into dragonpilot-dev-zht
# Conflicts: # apk/ai.comma.plus.offroad.apk
This commit is contained in:
@@ -82,6 +82,8 @@ keys = {
|
||||
"DragonDisableDriverSafetyCheck": [TxType.PERSISTENT],
|
||||
"DragonAutoShutdownAt": [TxType.PERSISTENT],
|
||||
"DragonTempDisableSteerOnSignal": [TxType.PERSISTENT],
|
||||
"DragonDisableLogger": [TxType.PERSISTENT],
|
||||
"DragonNoctuaMode": [TxType.PERSISTENT],
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -10,40 +10,11 @@ default_conf = {
|
||||
'DragonDisableDriverSafetyCheck': '0',
|
||||
'DragonAutoShutdownAt': '30', # in minute
|
||||
'DragonTempDisableSteerOnSignal': '0',
|
||||
'DragonDisableLogger': '0',
|
||||
'DragonNoctuaMode': '0',
|
||||
}
|
||||
|
||||
# def write_json_config(config):
|
||||
# with open(file, 'w') as f:
|
||||
# json.dump(config, f, indent=2, sort_keys=True)
|
||||
# os.chmod(file, 0644)
|
||||
|
||||
def dragonpilot_set_params(params):
|
||||
# # create new json file
|
||||
# if not os.path.isfile(file):
|
||||
# write_json_config(default_conf)
|
||||
# config = default_conf
|
||||
# else:
|
||||
# # load from json
|
||||
# with open(file, 'r') as f:
|
||||
# config = json.load(f)
|
||||
#
|
||||
# json_update_needed = False
|
||||
# # add new keys
|
||||
# for key, val in default_conf.items():
|
||||
# if key not in config:
|
||||
# json_update_needed = True
|
||||
# config[key] = val
|
||||
#
|
||||
# # remove invalid keys
|
||||
# for key, val in config.items():
|
||||
# if key not in default_conf:
|
||||
# json_update_needed = True
|
||||
# config.pop(key, None)
|
||||
#
|
||||
# # write to json if update needed
|
||||
# if json_update_needed:
|
||||
# write_json_config(config)
|
||||
|
||||
# set params
|
||||
for key, val in default_conf.items():
|
||||
if params.get(key) is None:
|
||||
|
||||
@@ -524,6 +524,11 @@ def main():
|
||||
spinner_proc = subprocess.Popen(["./spinner", "loading %s"%spinner_text],
|
||||
cwd=os.path.join(BASEDIR, "selfdrive", "ui", "spinner"),
|
||||
close_fds=True)
|
||||
|
||||
if params.get("DragonDisableLogger") == "1":
|
||||
del managed_processes['loggerd']
|
||||
del managed_processes['tombstoned']
|
||||
|
||||
try:
|
||||
manager_update()
|
||||
manager_init()
|
||||
|
||||
@@ -11,6 +11,7 @@ from common.params import Params
|
||||
from common.realtime import sec_since_boot
|
||||
from common.numpy_fast import clip
|
||||
from common.filter_simple import FirstOrderFilter
|
||||
params = Params()
|
||||
|
||||
ThermalStatus = log.ThermalData.ThermalStatus
|
||||
CURRENT_TAU = 15. # 15s time constant
|
||||
@@ -82,6 +83,9 @@ _TEMP_THRS_L = [42.5, 57.5, 72.5, 10000]
|
||||
_FAN_SPEEDS = [0, 16384, 32768, 65535]
|
||||
# max fan speed only allowed if battery is hot
|
||||
_BAT_TEMP_THERSHOLD = 45.
|
||||
if params.get('DragonNoctuaMode') == "1":
|
||||
_FAN_SPEEDS = [65535, 65535, 65535, 65535]
|
||||
_BAT_TEMP_THERSHOLD = 20.
|
||||
|
||||
|
||||
def handle_fan(max_cpu_temp, bat_temp, fan_speed):
|
||||
@@ -146,8 +150,6 @@ def thermald_thread():
|
||||
charging_disabled = False
|
||||
os.system('echo "1" > /sys/class/power_supply/battery/charging_enabled')
|
||||
|
||||
params = Params()
|
||||
|
||||
while 1:
|
||||
health = messaging.recv_sock(health_sock, wait=True)
|
||||
location = messaging.recv_sock(location_sock)
|
||||
|
||||
Reference in New Issue
Block a user