From daf160a27c7a9e86bd8caae37bad45dd2a51f104 Mon Sep 17 00:00:00 2001 From: Dean Lee Date: Sat, 23 Jan 2021 07:25:54 +0800 Subject: [PATCH] boardd: declare MessageBuilder close to usage (#19883) old-commit-hash: 2df9736bb260b4efa1661d678395f630a0c4f407 --- selfdrive/boardd/boardd.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/selfdrive/boardd/boardd.cc b/selfdrive/boardd/boardd.cc index 795bf3bf48..4659bd959a 100644 --- a/selfdrive/boardd/boardd.cc +++ b/selfdrive/boardd/boardd.cc @@ -287,9 +287,6 @@ void can_health_thread() { // run at 2hz while (!do_exit && panda->connected) { - MessageBuilder msg; - auto healthData = msg.initEvent().initHealth(); - health_t health = panda->get_health(); if (spoofing_started) { @@ -349,6 +346,8 @@ void can_health_thread() { uint16_t fan_speed_rpm = panda->get_fan_speed(); // set fields + MessageBuilder msg; + auto healthData = msg.initEvent().initHealth(); healthData.setUptime(health.uptime); #ifdef QCOM2