Make tests pass

This commit is contained in:
Daniel Öster 2025-08-31 15:08:45 +03:00
parent 0e904f9465
commit 7c72526946
2 changed files with 10 additions and 13 deletions

View file

@ -92,7 +92,6 @@ bool init_CAN() {
const uint32_t errorCode = ACAN_ESP32::can.begin(*settingsespcan);
if (errorCode == 0) {
native_can_initialized = true;
#ifdef DEBUG_LOG
logging.println("Native Can ok");
logging.print("Bit Rate prescaler: ");
logging.println(settingsespcan->mBitRatePrescaler);
@ -112,12 +111,9 @@ bool init_CAN() {
logging.print("Sample point: ");
logging.print(settingsespcan->samplePointFromBitStart());
logging.println("%");
#endif // DEBUG_LOG
} else {
#ifdef DEBUG_LOG
logging.print("Error Native Can: 0x");
logging.println(errorCode, HEX);
#endif // DEBUG_LOG
return false;
}
}
@ -233,9 +229,9 @@ void transmit_can_frame_to_interface(const CAN_frame* tx_frame, int interface) {
}
print_can_frame(*tx_frame, frameDirection(MSG_TX));
#ifdef LOG_CAN_TO_SD
add_can_frame_to_buffer(*tx_frame, frameDirection(MSG_TX));
#endif
if (datalayer.system.info.CAN_SD_logging_active) {
add_can_frame_to_buffer(*tx_frame, frameDirection(MSG_TX));
}
switch (interface) {
case CAN_NATIVE: {
@ -398,13 +394,13 @@ void map_can_frame_to_variable(CAN_frame* rx_frame, CAN_Interface interface) {
print_can_frame(*rx_frame, frameDirection(MSG_RX));
}
#ifdef LOG_CAN_TO_SD
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));
if (datalayer.system.info.CAN_SD_logging_active) {
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
// Send the frame to all the receivers registered for this interface.
auto receivers = can_receivers.equal_range(interface);

View file

@ -1,6 +1,7 @@
#ifndef PREFERENCES
#define PREFERENCES
#include <WString.h>
#include <stdint.h>
class Preferences {