pandad: fall back to panda voltage and current measurements (#33935)

pull/33937/head
Adeeb Shihadeh 10 months ago committed by GitHub
parent 12fd9e441f
commit 954fa5e6da
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 10
      selfdrive/pandad/pandad.cc

@ -306,6 +306,16 @@ void send_peripheral_state(Panda *panda, PubMaster *pm) {
LOGW("reading hwmon took %lfms", read_time);
}
// fall back to panda's voltage and current measurement
if (ps.getVoltage() == 0 && ps.getCurrent() == 0) {
auto health_opt = panda->get_state();
if (health_opt) {
health_t health = *health_opt;
ps.setVoltage(health.voltage_pkt);
ps.setCurrent(health.current_pkt);
}
}
uint16_t fan_speed_rpm = panda->get_fan_speed();
ps.setFanSpeedRpm(fan_speed_rpm);

Loading…
Cancel
Save