pandad: move getenv check to global scope (#33235)

move getenv check to global
old-commit-hash: ad33cae40e03a99c4029f567dc3b67baef340450
This commit is contained in:
Dean Lee
2024-08-08 23:45:03 +08:00
committed by GitHub
parent 6a2b4dedfc
commit fcba77b59e

View File

@@ -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<can_frame>& 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);
}