Skip to content

Commit

Permalink
Add code to stop updates on C2
Browse files Browse the repository at this point in the history
  • Loading branch information
sshane committed May 11, 2022
1 parent 32ded66 commit d882752
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions selfdrive/common/params.cc
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ std::unordered_map<std::string, uint32_t> keys = {
{"Offroad_TemperatureTooHigh", CLEAR_ON_MANAGER_START},
{"Offroad_UnofficialHardware", CLEAR_ON_MANAGER_START},
{"Offroad_UpdateFailed", CLEAR_ON_MANAGER_START},
{"Offroad_NoMoreUpdates", PERSISTENT},
};

} // namespace
Expand Down
4 changes: 4 additions & 0 deletions selfdrive/controls/lib/alerts_offroad.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
"severity": 1,
"_comment": "Append the command and error to the text."
},
"Offroad_NoMoreUpdates": {
"text": "SA-master has been updated to a commit that deprecates C2 support, your device will no longer update on this branch.",
"severity": 1
},
"Offroad_InvalidTime": {
"text": "Invalid date and time settings, system won't start. Connect to internet to set time.",
"severity": 1
Expand Down
3 changes: 3 additions & 0 deletions selfdrive/thermald/thermald.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,9 @@ def thermald_thread() -> NoReturn:

if EON and not is_uno:
set_offroad_alert_if_changed("Offroad_ChargeDisabled", (not usb_power))
if EON:
set_offroad_alert("Offroad_NoMoreUpdates", True)
params.put_bool("DisableUpdates", True)

should_start_prev = should_start
startup_conditions_prev = startup_conditions.copy()
Expand Down
6 changes: 3 additions & 3 deletions selfdrive/updated.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,9 +391,9 @@ def main() -> None:
auto_reboot = AutoReboot()
params = Params()

if params.get_bool("DisableUpdates"):
cloudlog.warning("updates are disabled by the DisableUpdates param")
exit(0)
# if params.get_bool("DisableUpdates"):
# cloudlog.warning("updates are disabled by the DisableUpdates param")
# exit(0)

ov_lock_fd = open(LOCK_FILE, 'w')
try:
Expand Down

0 comments on commit d882752

Please sign in to comment.