FPv2: don't multiplex second panda (#27663)

* fix this way

* or can fix this way

* simplify

* fix
pull/27660/head
Shane Smiskol 2 years ago committed by GitHub
parent 1a560a1a6c
commit a0e225e4af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      selfdrive/boardd/boardd.cc

@ -127,8 +127,8 @@ bool safety_setter_thread(std::vector<Panda *> pandas) {
bool obd_multiplexing_requested = p.getBool("ObdMultiplexingEnabled");
if (obd_multiplexing_requested != obd_multiplexing_enabled) {
const uint16_t safety_param = obd_multiplexing_requested ? 0U : 1U;
for (int i = 0; i < pandas.size(); i++) {
const uint16_t safety_param = (i > 0 || !obd_multiplexing_requested) ? 1U : 0U;
pandas[i]->set_safety_model(cereal::CarParams::SafetyModel::ELM327, safety_param);
}
obd_multiplexing_enabled = obd_multiplexing_requested;

Loading…
Cancel
Save