mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-03-02 07:24:12 +08:00
FPv2: don't multiplex second panda (#27663)
* fix this way
* or can fix this way
* simplify
* fix
old-commit-hash: a0e225e4af
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user