Add CLEAR_ON_IGNITION_OFF param type (#21121)
old-commit-hash: 36beaf0d6895c9d69d05c3a25eab21a4d9dbb692
This commit is contained in:
@@ -12,7 +12,8 @@ cdef extern from "selfdrive/common/params.h":
|
|||||||
PERSISTENT
|
PERSISTENT
|
||||||
CLEAR_ON_MANAGER_START
|
CLEAR_ON_MANAGER_START
|
||||||
CLEAR_ON_PANDA_DISCONNECT
|
CLEAR_ON_PANDA_DISCONNECT
|
||||||
CLEAR_ON_IGNITION
|
CLEAR_ON_IGNITION_ON
|
||||||
|
CLEAR_ON_IGNITION_OFF
|
||||||
ALL
|
ALL
|
||||||
|
|
||||||
cdef cppclass Params:
|
cdef cppclass Params:
|
||||||
|
|||||||
@@ -13,7 +13,8 @@ cdef class ParamKeyType:
|
|||||||
PERSISTENT = c_ParamKeyType.PERSISTENT
|
PERSISTENT = c_ParamKeyType.PERSISTENT
|
||||||
CLEAR_ON_MANAGER_START = c_ParamKeyType.CLEAR_ON_MANAGER_START
|
CLEAR_ON_MANAGER_START = c_ParamKeyType.CLEAR_ON_MANAGER_START
|
||||||
CLEAR_ON_PANDA_DISCONNECT = c_ParamKeyType.CLEAR_ON_PANDA_DISCONNECT
|
CLEAR_ON_PANDA_DISCONNECT = c_ParamKeyType.CLEAR_ON_PANDA_DISCONNECT
|
||||||
CLEAR_ON_IGNITION = c_ParamKeyType.CLEAR_ON_IGNITION
|
CLEAR_ON_IGNITION_ON = c_ParamKeyType.CLEAR_ON_IGNITION_ON
|
||||||
|
CLEAR_ON_IGNITION_OFF = c_ParamKeyType.CLEAR_ON_IGNITION_OFF
|
||||||
ALL = c_ParamKeyType.ALL
|
ALL = c_ParamKeyType.ALL
|
||||||
|
|
||||||
def ensure_bytes(v):
|
def ensure_bytes(v):
|
||||||
|
|||||||
@@ -304,7 +304,7 @@ void panda_state_thread(bool spoofing_started) {
|
|||||||
|
|
||||||
// clear VIN, CarParams, and set new safety on car start
|
// clear VIN, CarParams, and set new safety on car start
|
||||||
if (ignition && !ignition_last) {
|
if (ignition && !ignition_last) {
|
||||||
params.clearAll(CLEAR_ON_IGNITION);
|
params.clearAll(CLEAR_ON_IGNITION_ON);
|
||||||
|
|
||||||
if (!safety_setter_thread_running) {
|
if (!safety_setter_thread_running) {
|
||||||
safety_setter_thread_running = true;
|
safety_setter_thread_running = true;
|
||||||
@@ -312,6 +312,8 @@ void panda_state_thread(bool spoofing_started) {
|
|||||||
} else {
|
} else {
|
||||||
LOGW("Safety setter thread already running");
|
LOGW("Safety setter thread already running");
|
||||||
}
|
}
|
||||||
|
} else if (!ignition && ignition_last) {
|
||||||
|
params.clearAll(CLEAR_ON_IGNITION_OFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write to rtc once per minute when no ignition present
|
// Write to rtc once per minute when no ignition present
|
||||||
|
|||||||
@@ -148,11 +148,11 @@ std::unordered_map<std::string, uint32_t> keys = {
|
|||||||
{"AthenadPid", PERSISTENT},
|
{"AthenadPid", PERSISTENT},
|
||||||
{"CalibrationParams", PERSISTENT},
|
{"CalibrationParams", PERSISTENT},
|
||||||
{"CarBatteryCapacity", PERSISTENT},
|
{"CarBatteryCapacity", PERSISTENT},
|
||||||
{"CarParams", CLEAR_ON_MANAGER_START | CLEAR_ON_PANDA_DISCONNECT | CLEAR_ON_IGNITION},
|
{"CarParams", CLEAR_ON_MANAGER_START | CLEAR_ON_PANDA_DISCONNECT | CLEAR_ON_IGNITION_ON},
|
||||||
{"CarParamsCache", CLEAR_ON_MANAGER_START | CLEAR_ON_PANDA_DISCONNECT},
|
{"CarParamsCache", CLEAR_ON_MANAGER_START | CLEAR_ON_PANDA_DISCONNECT},
|
||||||
{"CarVin", CLEAR_ON_MANAGER_START | CLEAR_ON_PANDA_DISCONNECT | CLEAR_ON_IGNITION},
|
{"CarVin", CLEAR_ON_MANAGER_START | CLEAR_ON_PANDA_DISCONNECT | CLEAR_ON_IGNITION_ON},
|
||||||
{"CommunityFeaturesToggle", PERSISTENT},
|
{"CommunityFeaturesToggle", PERSISTENT},
|
||||||
{"ControlsReady", CLEAR_ON_MANAGER_START | CLEAR_ON_PANDA_DISCONNECT | CLEAR_ON_IGNITION},
|
{"ControlsReady", CLEAR_ON_MANAGER_START | CLEAR_ON_PANDA_DISCONNECT | CLEAR_ON_IGNITION_ON},
|
||||||
{"EnableLteOnroad", PERSISTENT},
|
{"EnableLteOnroad", PERSISTENT},
|
||||||
{"EndToEndToggle", PERSISTENT},
|
{"EndToEndToggle", PERSISTENT},
|
||||||
{"CompletedTrainingVersion", PERSISTENT},
|
{"CompletedTrainingVersion", PERSISTENT},
|
||||||
|
|||||||
@@ -12,8 +12,9 @@ enum ParamKeyType {
|
|||||||
PERSISTENT = 0x02,
|
PERSISTENT = 0x02,
|
||||||
CLEAR_ON_MANAGER_START = 0x04,
|
CLEAR_ON_MANAGER_START = 0x04,
|
||||||
CLEAR_ON_PANDA_DISCONNECT = 0x08,
|
CLEAR_ON_PANDA_DISCONNECT = 0x08,
|
||||||
CLEAR_ON_IGNITION = 0x10,
|
CLEAR_ON_IGNITION_ON = 0x10,
|
||||||
ALL = 0x02 | 0x04 | 0x08 | 0x10
|
CLEAR_ON_IGNITION_OFF = 0x20,
|
||||||
|
ALL = 0x02 | 0x04 | 0x08 | 0x10 | 0x20
|
||||||
};
|
};
|
||||||
|
|
||||||
class Params {
|
class Params {
|
||||||
|
|||||||
Reference in New Issue
Block a user