register clearpilot memory params and seed defaults in manager_init
Scaffolding for the upcoming UI port. Registers the keys the new C++ UI and SpeedState daemon will read/write, and seeds /dev/shm/params defaults at manager start so first-readers don't see missing keys before writers spin up. Keys registered: CarIsMetric, ClearpilotCruiseWarning, ClearpilotCruiseWarningSpeed, ClearpilotHasSpeed, ClearpilotIsMetric, ClearpilotPlayDing, ClearpilotShowHealthMetrics, ClearpilotSpeedDisplay, ClearpilotSpeedLimitDisplay, ClearpilotSpeedUnit, DashcamFrames, DashcamShutdown, DashcamState, IsDaylight, ModelFps, ModelStandby, ModelStandbyTs, ScreenRecorderDebug, ShutdownTouchReset, TelemetryEnabled, VpnEnabled. PERSISTENT registration here is purely a no-op placeholder: the actual storage is /dev/shm/params (tmpfs), which clears on every reboot regardless. Bench-mode keys (Bench*, ClpUiState, LogDirInitialized) not registered yet — they'll come with their respective features.
This commit is contained in:
@@ -301,6 +301,32 @@ def manager_init(frogpilot_functions) -> None:
|
||||
else:
|
||||
params_storage.put(k, params.get(k))
|
||||
|
||||
# CLEARPILOT memory-param defaults. /dev/shm/params is on tmpfs so these
|
||||
# reset on every boot anyway; we still set them so first-readers don't see
|
||||
# missing keys before the writer process has spun up.
|
||||
params_memory = Params("/dev/shm/params")
|
||||
for k, v in [
|
||||
("CarIsMetric", "0"),
|
||||
("ClearpilotCruiseWarning", ""),
|
||||
("ClearpilotCruiseWarningSpeed", ""),
|
||||
("ClearpilotHasSpeed", "0"),
|
||||
("ClearpilotIsMetric", "0"),
|
||||
("ClearpilotPlayDing", "0"),
|
||||
("ClearpilotSpeedDisplay", ""),
|
||||
("ClearpilotSpeedLimitDisplay", "0"),
|
||||
("ClearpilotSpeedUnit", "mph"),
|
||||
("DashcamFrames", "0"),
|
||||
("DashcamShutdown", "0"),
|
||||
("DashcamState", "stopped"),
|
||||
("ModelFps", "20"),
|
||||
("ModelStandby", "0"),
|
||||
("ModelStandbyTs", "0"),
|
||||
("ShutdownTouchReset", "0"),
|
||||
("TelemetryEnabled", "0"),
|
||||
("VpnEnabled", "1"),
|
||||
]:
|
||||
params_memory.put(k, v)
|
||||
|
||||
# Create folders needed for msgq
|
||||
try:
|
||||
os.mkdir("/dev/shm")
|
||||
|
||||
Reference in New Issue
Block a user