From 2ad2756ca9ec0e36d8de6977406bd6190b51c51e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20=C3=96ster?= Date: Tue, 4 Mar 2025 14:36:15 +0200 Subject: [PATCH] Extend comment, fix also SD logging twice --- Software/src/communication/can/comm_can.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Software/src/communication/can/comm_can.cpp b/Software/src/communication/can/comm_can.cpp index 8530ef15..2695b965 100644 --- a/Software/src/communication/can/comm_can.cpp +++ b/Software/src/communication/can/comm_can.cpp @@ -297,12 +297,18 @@ void print_can_frame(CAN_frame frame, frameDirection msgDir) { } void map_can_frame_to_variable(CAN_frame* rx_frame, int interface) { - if (interface != CANFD_NATIVE) { //Avoid printing twice in receive_frame_canfd_addon + if (interface != + CANFD_NATIVE) { //Avoid printing twice due to receive_frame_canfd_addon sending to both FD interfaces + //TODO: This check can be removed later when refactored to use inline functions for logging print_can_frame(*rx_frame, frameDirection(MSG_RX)); } #ifdef LOG_CAN_TO_SD - add_can_frame_to_buffer(*rx_frame, frameDirection(MSG_RX)); + if (interface != + CANFD_NATIVE) { //Avoid printing twice due to receive_frame_canfd_addon sending to both FD interfaces + //TODO: This check can be removed later when refactored to use inline functions for logging + add_can_frame_to_buffer(*rx_frame, frameDirection(MSG_RX)); + } #endif if (interface == can_config.battery) {