pandad: add log_once_ to prevent repeated logging (#33505)

add log_once_ flag
pull/33514/head^2
Dean Lee 8 months ago committed by GitHub
parent e3f05db3e0
commit ee6d7aeb53
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 8
      selfdrive/pandad/panda_safety.cc
  2. 1
      selfdrive/pandad/pandad.h

@ -17,6 +17,7 @@ void PandaSafety::configureSafetyMode() {
} else if (!is_onroad) {
initialized_ = false;
safety_configured_ = false;
log_once_ = false;
}
}
@ -46,9 +47,12 @@ std::string PandaSafety::fetchCarParams() {
if (!params_.getBool("FirmwareQueryDone")) {
return {};
}
LOGW("Finished FW query");
LOGW("Waiting for params to set safety model");
if (!log_once_) {
LOGW("Finished FW query, Waiting for params to set safety model");
log_once_ = true;
}
if (!params_.getBool("ControlsReady")) {
return {};
}

@ -19,6 +19,7 @@ private:
void setSafetyMode(const std::string &params_string);
bool initialized_ = false;
bool log_once_ = false;
bool safety_configured_ = false;
bool prev_obd_multiplexing_ = false;
std::vector<Panda *> pandas_;

Loading…
Cancel
Save