From 2eac604993530fab8e10d9d546bcbb7fe0c0374c Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Wed, 14 Apr 2021 21:19:06 -0700 Subject: [PATCH] lte toggle (#20683) --- common/params_pyx.pyx | 1 + selfdrive/thermald/thermald.py | 2 +- selfdrive/ui/qt/offroad/settings.cc | 6 ++++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/common/params_pyx.pyx b/common/params_pyx.pyx index 475931cac..c300f954a 100755 --- a/common/params_pyx.pyx +++ b/common/params_pyx.pyx @@ -25,6 +25,7 @@ keys = { b"CarParamsCache": [TxType.CLEAR_ON_MANAGER_START, TxType.CLEAR_ON_PANDA_DISCONNECT], b"CarVin": [TxType.CLEAR_ON_MANAGER_START, TxType.CLEAR_ON_PANDA_DISCONNECT], b"CommunityFeaturesToggle": [TxType.PERSISTENT], + b"EnableLteOnroad": [TxType.PERSISTENT], b"EndToEndToggle": [TxType.PERSISTENT], b"CompletedTrainingVersion": [TxType.PERSISTENT], b"DisablePowerDown": [TxType.PERSISTENT], diff --git a/selfdrive/thermald/thermald.py b/selfdrive/thermald/thermald.py index 4d37b56a8..f19c7bb85 100755 --- a/selfdrive/thermald/thermald.py +++ b/selfdrive/thermald/thermald.py @@ -349,7 +349,7 @@ def thermald_thread(): if should_start != should_start_prev or (count == 0): params.put_bool("IsOffroad", not should_start) HARDWARE.set_power_save(not should_start) - if TICI: + if TICI and not params.get_bool("EnableLteOnroad"): fxn = "stop" if should_start else "start" os.system(f"sudo systemctl {fxn} --no-block lte") diff --git a/selfdrive/ui/qt/offroad/settings.cc b/selfdrive/ui/qt/offroad/settings.cc index 1af85a83d..e11c4fe03 100644 --- a/selfdrive/ui/qt/offroad/settings.cc +++ b/selfdrive/ui/qt/offroad/settings.cc @@ -72,6 +72,12 @@ TogglesPanel::TogglesPanel(QWidget *parent) : QWidget(parent) { "Use wide angle camera for driving and ui. Only takes effect after reboot.", "../assets/offroad/icon_openpilot.png", this)); + toggles.append(new ParamControl("EnableLteOnroad", + "Enable LTE while onroad", + "", + "../assets/offroad/icon_network.png", + this)); + #endif bool record_lock = Params().getBool("RecordFrontLock");