CSP Debug

File: csp/csp_debug.h

Description: NEW DEBUG API

Based on counters, and error numbers. This gets rid of a lot of verbose debugging strings while still maintaining the same level of debug capabilities.

Note

We choose to ignore atomic access to the counters right now. 1) Most of the access to these happens single threaded (router task) or within ISR (driver RX) 2) Having accurate error counters is NOT a priority. They are only there for debugging purposes. 3) Not all compilers have support for <stdatomic.h> yet.

Variables

extern uint8_t csp_dbg_buffer_out
[source]

Error counters

uextern uint8_t8_t csp_dbg_conn_out
uextern uint8_t8_t csp_dbg_conn_ovf
uextern uint8_t8_t csp_dbg_conn_noroute
uextern uint8_t8_t csp_dbg_inval_reply
uextern uint8_t8_t csp_dbg_errno
uextern uint8_t8_t csp_dbg_can_errno
uextern uint8_t8_t csp_dbg_eth_errno
uextern uint8_t8_t csp_dbg_rdp_print
uextern uint8_t8_t csp_dbg_packet_print

Defines

General error codes

CSP_DBG_ERR_CORRUPT_BUFFER
[source]
CSP_DBG_ERR_MTU_EXCEEDED
[source]
CSP_DBG_ERR_ALREADY_FREE
[source]
CSP_DBG_ERR_REFCOUNT
[source]
CSP_DBG_ERR_INVALID_RTABLE_ENTRY
[source]
CSP_DBG_ERR_UNSUPPORTED
[source]
CSP_DBG_ERR_INVALID_BIND_PORT
[source]
CSP_DBG_ERR_PORT_ALREADY_IN_USE
[source]
CSP_DBG_ERR_ALREADY_CLOSED
[source]
CSP_DBG_ERR_INVALID_POINTER
[source]
CSP_DBG_ERR_CLOCK_SET_FAIL
[source]

CAN-specific error codes

CSP_DBG_CAN_ERR_FRAME_LOST
[source]
CSP_DBG_CAN_ERR_RX_OVF
[source]
CSP_DBG_CAN_ERR_RX_OUT
[source]
CSP_DBG_CAN_ERR_SHORT_BEGIN
[source]
CSP_DBG_CAN_ERR_INCOMPLETE
[source]
CSP_DBG_CAN_ERR_UNKNOWN
[source]

ETH-specific error codes

CSP_DBG_ETH_ERR_FRAME_LOST
[source]
CSP_DBG_ETH_ERR_RX_OVF
[source]
CSP_DBG_ETH_ERR_RX_OUT
[source]
CSP_DBG_ETH_ERR_SHORT_BEGIN
[source]
CSP_DBG_ETH_ERR_INCOMPLETE
[source]
CSP_DBG_ETH_ERR_UNKNOWN
[source]

Functions

void csp_print_func(const char *fmt, ...)
[source]