From ad33cae40e03a99c4029f567dc3b67baef340450 Mon Sep 17 00:00:00 2001 From: Dean Lee Date: Thu, 8 Aug 2024 23:45:03 +0800 Subject: [PATCH] pandad: move getenv check to global scope (#33235) move getenv check to global --- selfdrive/pandad/panda.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/selfdrive/pandad/panda.cc b/selfdrive/pandad/panda.cc index ed5ee62501..bc81d7de91 100644 --- a/selfdrive/pandad/panda.cc +++ b/selfdrive/pandad/panda.cc @@ -10,6 +10,8 @@ #include "common/swaglog.h" #include "common/util.h" +const bool PANDAD_MAXOUT = getenv("PANDAD_MAXOUT") != nullptr; + Panda::Panda(std::string serial, uint32_t bus_offset) : bus_offset(bus_offset) { // try USB first, then SPI try { @@ -219,7 +221,7 @@ bool Panda::can_receive(std::vector& out_vec) { return false; } - if (getenv("PANDAD_MAXOUT") != NULL) { + if (PANDAD_MAXOUT) { static uint8_t junk[RECV_SIZE]; handle->bulk_read(0xab, junk, RECV_SIZE - recv); }