From 574d09e29ee78a9bc591a1c6e96da6a90a6dd20f Mon Sep 17 00:00:00 2001 From: rusefillc Date: Wed, 8 Dec 2021 18:43:27 -0500 Subject: [PATCH] rusEFI console ISO-TP via PCAN #3667 changing this mess just a bit --- firmware/console/binary/serial_can.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/firmware/console/binary/serial_can.cpp b/firmware/console/binary/serial_can.cpp index 3f2360d927..89b09aa6f4 100644 --- a/firmware/console/binary/serial_can.cpp +++ b/firmware/console/binary/serial_can.cpp @@ -14,21 +14,21 @@ #include "os_access.h" #include "crc.h" -#if HAL_USE_CAN +// todo: this file is asking to improve conditional compilation. unit_tests and cypress/kinetis are both special cases +#if HAL_USE_CAN || EFI_UNIT_TEST #include "serial_can.h" #include "can.h" #include "can_msg_tx.h" +#endif // HAL_USE_CAN || EFI_UNIT_TEST - CanStreamer streamer; +#if HAL_USE_CAN +static CanStreamer streamer; static CanStreamerState state(&streamer); static CanTsListener listener; #endif // HAL_USE_CAN #if HAL_USE_CAN || EFI_UNIT_TEST -#include "serial_can.h" -#include "can.h" -#include "can_msg_tx.h" int CanStreamerState::sendFrame(const IsoTpFrameHeader & header, const uint8_t *data, int num, can_sysinterval_t timeout) { int dlc = 8; // standard 8 bytes