log on startup if onroad flag set (#21150)

old-commit-hash: 96271f8bc3
commatwo_master
Adeeb Shihadeh 4 years ago committed by GitHub
parent 777b84a064
commit 7cdcb7a52a
  1. 1
      selfdrive/common/params.cc
  2. 4
      selfdrive/thermald/thermald.py

@ -174,6 +174,7 @@ std::unordered_map<std::string, uint32_t> keys = {
{"IsLdwEnabled", PERSISTENT}, {"IsLdwEnabled", PERSISTENT},
{"IsMetric", PERSISTENT}, {"IsMetric", PERSISTENT},
{"IsOffroad", CLEAR_ON_MANAGER_START}, {"IsOffroad", CLEAR_ON_MANAGER_START},
{"IsOnroad", PERSISTENT},
{"IsRHD", PERSISTENT}, {"IsRHD", PERSISTENT},
{"IsTakingSnapshot", CLEAR_ON_MANAGER_START}, {"IsTakingSnapshot", CLEAR_ON_MANAGER_START},
{"IsUpdateAvailable", CLEAR_ON_MANAGER_START}, {"IsUpdateAvailable", CLEAR_ON_MANAGER_START},

@ -171,6 +171,9 @@ def thermald_thread():
thermal_config = HARDWARE.get_thermal_config() thermal_config = HARDWARE.get_thermal_config()
if params.get_bool("IsOnroad"):
cloudlog.event("onroad flag not cleared")
# CPR3 logging # CPR3 logging
if EON: if EON:
base_path = "/sys/kernel/debug/cpr3-regulator/" base_path = "/sys/kernel/debug/cpr3-regulator/"
@ -356,6 +359,7 @@ def thermald_thread():
# Handle offroad/onroad transition # Handle offroad/onroad transition
should_start = all(startup_conditions.values()) should_start = all(startup_conditions.values())
if should_start != should_start_prev or (count == 0): if should_start != should_start_prev or (count == 0):
params.put_bool("IsOnroad", should_start)
params.put_bool("IsOffroad", not should_start) params.put_bool("IsOffroad", not should_start)
HARDWARE.set_power_save(not should_start) HARDWARE.set_power_save(not should_start)
if TICI and not params.get_bool("EnableLteOnroad"): if TICI and not params.get_bool("EnableLteOnroad"):

Loading…
Cancel
Save