mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-03 01:39:30 +02:00
Make tests pass
This commit is contained in:
parent
0e904f9465
commit
7c72526946
2 changed files with 10 additions and 13 deletions
|
@ -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
|
||||
if (datalayer.system.info.CAN_SD_logging_active) {
|
||||
add_can_frame_to_buffer(*tx_frame, frameDirection(MSG_TX));
|
||||
#endif
|
||||
}
|
||||
|
||||
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 (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);
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#ifndef PREFERENCES
|
||||
#define PREFERENCES
|
||||
|
||||
#include <WString.h>
|
||||
#include <stdint.h>
|
||||
|
||||
class Preferences {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue