Red Bird Racing VCU v2
 
Loading...
Searching...
No Matches
Debug.hpp File Reference

Debugging macros and functions for serial and CAN output. More...

#include "Enums.hpp"
#include <mcp2515.h>
Include dependency graph for Debug.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define DEBUG   0
 
#define DEBUG_SERIAL   (1 && DEBUG)
 
#define DEBUG_CAN   (1 && DEBUG)
 
#define DEBUG_GENERAL   1
 

Functions

void DBG_GENERAL (const char *x)
 Prints a general debug message to the serial console.
 
void DBGLN_GENERAL (const char *x)
 Prints a line to the serial console for general debug.
 
void DBG_GENERAL_CAN (canid_t id, uint8_t data0=0x00, uint8_t data1=0x00, uint8_t data2=0x00, uint8_t data3=0x00, uint8_t data4=0x00, uint8_t data5=0x00, uint8_t data6=0x00, uint8_t data7=0x00)
 Sends arbitrary debug data via CAN with specified message ID and data bytes.
 

Detailed Description

Debugging macros and functions for serial and CAN output.

Author
Planeson, Chiho, Red Bird Racing
Version
2.0
Date
2026-02-25
See also
Debug_serial, Debug_can

Definition in file Debug.hpp.

Macro Definition Documentation

◆ DEBUG

#define DEBUG   0

Definition at line 23 of file Debug.hpp.

◆ DEBUG_CAN

#define DEBUG_CAN   (1 && DEBUG)

Definition at line 25 of file Debug.hpp.

◆ DEBUG_GENERAL

#define DEBUG_GENERAL   1

Definition at line 35 of file Debug.hpp.

◆ DEBUG_SERIAL

#define DEBUG_SERIAL   (1 && DEBUG)

Definition at line 24 of file Debug.hpp.

Function Documentation

◆ DBG_GENERAL()

void DBG_GENERAL ( const char *  x)
inline

Prints a general debug message to the serial console.

Parameters
xThe message to print.
Note
Serial exclusive

Definition at line 44 of file Debug.hpp.

References Debug_Serial::print().

Here is the call graph for this function:

◆ DBG_GENERAL_CAN()

void DBG_GENERAL_CAN ( canid_t  id,
uint8_t  data0 = 0x00,
uint8_t  data1 = 0x00,
uint8_t  data2 = 0x00,
uint8_t  data3 = 0x00,
uint8_t  data4 = 0x00,
uint8_t  data5 = 0x00,
uint8_t  data6 = 0x00,
uint8_t  data7 = 0x00 
)
inline

Sends arbitrary debug data via CAN with specified message ID and data bytes.

Parameters
idCAN message ID
data0Byte 0 of CAN data (default 0x00)
data1Byte 1 of CAN data (default 0x00)
data2Byte 2 of CAN data (default 0x00)
data3Byte 3 of CAN data (default 0x00)
data4Byte 4 of CAN data (default 0x00)
data5Byte 5 of CAN data (default 0x00)
data6Byte 6 of CAN data (default 0x00)
data7Byte 7 of CAN data (default 0x00)
Note
CAN exclusive

Definition at line 78 of file Debug.hpp.

References Debug_CAN::send_message().

Here is the call graph for this function:

◆ DBGLN_GENERAL()

void DBGLN_GENERAL ( const char *  x)
inline

Prints a line to the serial console for general debug.

Parameters
xThe message to print.
Note
Serial exclusive

Definition at line 56 of file Debug.hpp.

References Debug_Serial::println().

Referenced by BMS::checkHv(), and setup().

Here is the call graph for this function:
Here is the caller graph for this function: