Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
[submodule "panda"]
path = panda
url = ../../commaai/panda.git
branch = body-v1-update
[submodule "opendbc"]
path = opendbc_repo
url = ../../commaai/opendbc.git
branch = body-v1-update
[submodule "msgq"]
path = msgq_repo
url = ../../commaai/msgq.git
Expand Down
1 change: 1 addition & 0 deletions common/params_keys.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ inline static std::unordered_map<std::string, ParamKeyAttributes> keys = {
{"AthenadPid", {PERSISTENT, INT}},
{"AthenadUploadQueue", {PERSISTENT, JSON}},
{"AthenadRecentlyViewedRoutes", {PERSISTENT, STRING}},
{"BodyFirmwareFlashing", {CLEAR_ON_MANAGER_START, BOOL}},
{"BootCount", {PERSISTENT, INT}},
{"CalibrationParams", {PERSISTENT, BYTES}},
{"CameraDebugExpGain", {CLEAR_ON_MANAGER_START, STRING}},
Expand Down
2 changes: 1 addition & 1 deletion panda
12 changes: 9 additions & 3 deletions selfdrive/pandad/pandad.cc
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,12 @@ std::optional<bool> send_panda_states(PubMaster *pm, Panda *panda, bool is_onroa
health.ignition_line_pkt = 1;
}

static Params params;
if (params.getBool("BodyFirmwareFlashing")) {
health.ignition_line_pkt = 1;
health.safety_mode_pkt = (uint8_t)(cereal::CarParams::SafetyModel::BODY);
}

bool ignition_local = ((health.ignition_line_pkt != 0) || (health.ignition_can_pkt != 0));

// Make sure CAN buses are live: safety_setter_thread does not work if Panda CAN are silent and there is only one other CAN node
Expand Down Expand Up @@ -341,9 +347,9 @@ void process_peripheral_state(Panda *panda, PubMaster *pm, bool no_fan_control)
}

if (ir_pwr != prev_ir_pwr || sm.frame % 100 == 0) {
int16_t ir_panda = util::map_val(ir_pwr, 0, 100, 0, MAX_IR_PANDA_VAL);
int16_t ir_panda = util::map_val(ir_pwr, 0, 100, 0, MAX_IR_PANDA_VAL);
panda->set_ir_pwr(ir_panda);
Hardware::set_ir_power(ir_pwr);
Hardware::set_ir_power(ir_pwr);
prev_ir_pwr = ir_pwr;
}
}
Expand All @@ -367,7 +373,7 @@ void pandad_run(Panda *panda) {

// Main loop: receive CAN data and process states
while (!do_exit && check_connected(panda)) {
can_recv(panda, &pm);
if (!params.getBool("BodyFirmwareFlashing")) can_recv(panda, &pm);

// Process peripheral state at 20 Hz
if (rk.frame() % 5 == 0) {
Expand Down
Loading