pandad: allow disabling driver camera IR offroad (#38812)

This commit is contained in:
Trey Moen
2026-09-08 15:21:03 -07:00
committed by GitHub
parent 9946c521f7
commit 7bfe6ba4d0
2 changed files with 3 additions and 2 deletions
+1
View File
@@ -28,6 +28,7 @@ inline static std::unordered_map<std::string, ParamKeyAttributes> keys = {
{"ControlsReady", {CLEAR_ON_MANAGER_START | CLEAR_ON_ONROAD_TRANSITION, BOOL}},
{"CurrentBootlog", {PERSISTENT, STRING}},
{"CurrentRoute", {CLEAR_ON_MANAGER_START | CLEAR_ON_ONROAD_TRANSITION, STRING}},
{"DisableDriverCameraIR", {CLEAR_ON_MANAGER_START | CLEAR_ON_ONROAD_TRANSITION, BOOL}},
{"DisableLogging", {CLEAR_ON_MANAGER_START | CLEAR_ON_ONROAD_TRANSITION, BOOL}},
{"DisablePowerDown", {PERSISTENT, BOOL}},
{"DisableUpdates", {PERSISTENT, BOOL}},
+2 -2
View File
@@ -328,8 +328,8 @@ void process_peripheral_state(Panda *panda, PubMaster *pm, bool no_fan_control,
}
}
// Disable IR on input timeout
if (nanos_since_boot() - last_cabin_camera_t > 1e9) {
// Disable IR on input timeout or when requested offroad.
if (nanos_since_boot() - last_cabin_camera_t > 1e9 || (!is_onroad && params.getBool("DisableDriverCameraIR"))) {
ir_pwr = 0;
}