diff --git a/can/SConscript b/can/SConscript index f07234c111d..a28b7f305ab 100644 --- a/can/SConscript +++ b/can/SConscript @@ -5,6 +5,7 @@ import os envDBC = env.Clone() dbc_file_path = '-DDBC_FILE_PATH=\'"%s"\'' % (envDBC.Dir("..").abspath) envDBC['CXXFLAGS'] += [dbc_file_path] +envDBC['CXXFLAGS'] += ['-DIGNORE_DBC_CHECKS'] src = ["dbc.cc", "parser.cc", "packer.cc", "common.cc"] libs = [common, "capnp", "kj", "zmq"] diff --git a/can/parser.cc b/can/parser.cc index 3ed9f028806..67eaa8beb5b 100644 --- a/can/parser.cc +++ b/can/parser.cc @@ -274,10 +274,13 @@ void CANParser::UpdateCans(uint64_t nanos, const capnp::DynamicStruct::Reader& c } void CANParser::UpdateValid(uint64_t nanos) { + #ifndef IGNORE_DBC_CHECKS const bool show_missing = (last_nanos - first_nanos) > 8e9; + #endif bool _valid = true; bool _counters_valid = true; + #ifndef IGNORE_DBC_CHECKS for (const auto& kv : message_states) { const auto& state = kv.second; @@ -298,6 +301,7 @@ void CANParser::UpdateValid(uint64_t nanos) { _valid = false; } } + #endif can_invalid_cnt = _valid ? 0 : (can_invalid_cnt + 1); can_valid = (can_invalid_cnt < CAN_INVALID_CNT) && _counters_valid; }