px-fwlib 0.10.0
Cross-platform embedded library and documentation for 8/16/32-bit microcontrollers generated with Doxygen 1.9.2
px_dbg_ft.h : Debug Flow Trace module

Description

Log flow of a program to a RAM buffer for post mortem inspection.

File(s):

Macros

#define PX_DBG_FT   1
 Set flag to disable (PX_DBG_FT=0) or enable (PX_DBG_FT=1) log output. More...
 
#define PX_DBG_FT_NAME(name)   PX_ATTR_UNUSED static const px_dbg_ft_name_t px_dbg_ft_name = name;
 Macro to declare a name value once at the top of each C file. More...
 
#define PX_DBG_FT_INIT()
 Macro to initialise debug flow trace module. More...
 
#define PX_DBG_FT_LOG()
 Macro to log a name and file line number. More...
 
#define PX_DBG_FT_LOG_LINE(line)
 Macro to log a name and a specified file line number. More...
 
#define PX_DBG_FT_LOG_PARAM(param)
 Macro to log a name, file line number and parameter. More...
 
#define PX_DBG_FT_LOG_LINE_PARAM(line, param)
 Macro to log a name, specified file line number and parameter. More...
 
#define PX_DBG_FT   0
 Disable (0) or Enable (1) debug flow trace. More...
 
#define PX_DBG_FT_CFG_BUF_SIZE   16
 Debug output string buffer size. More...
 

Enumerations

enum  px_dbg_ft_name_t
 Customized name values (must be sequential starting at 0, e.g. 0, 1, 2, 3, ...) More...
 

Functions

void _px_dbg_ft_init (void)
 Initialise debug flow trace module. More...
 
void _px_dbg_ft_log (const px_dbg_ft_name_t name, uint16_t line)
 Internal function to log a name and file line number. More...
 
void _px_dbg_ft_log_param (const px_dbg_ft_name_t name, uint16_t line, uint8_t param)
 Internal function to log a name, file line number and parameter. More...
 
void px_dbg_ft_report (void)
 Report flow trace logged in buffer. More...
 

Variables

uint8_t px_dbg_ft_buf_index
 Index of next empty position; Placed in .noinit section so that it is not set to zero by C initialization code before it can be inspected. More...
 
uint32_t px_dbg_ft_buf [PX_DBG_FT_CFG_BUF_SIZE]
 Buffer for log output; Placed in .noinit section so that it is not set to zero by C initialization code before it can be inspected. More...
 

Macro Definition Documentation

◆ PX_DBG_FT [1/2]

#define PX_DBG_FT   1

Set flag to disable (PX_DBG_FT=0) or enable (PX_DBG_FT=1) log output.

Definition at line 42 of file px_dbg_ft.h.

◆ PX_DBG_FT_NAME

#define PX_DBG_FT_NAME (   name)    PX_ATTR_UNUSED static const px_dbg_ft_name_t px_dbg_ft_name = name;

Macro to declare a name value once at the top of each C file.

Definition at line 112 of file px_dbg_ft.h.

◆ PX_DBG_FT_INIT

#define PX_DBG_FT_INIT ( )
Value:
do \
{ \
_px_dbg_ft_init(); \
} \
while(0)

Macro to initialise debug flow trace module.

Definition at line 115 of file px_dbg_ft.h.

◆ PX_DBG_FT_LOG

#define PX_DBG_FT_LOG ( )
Value:
do \
{ \
_px_dbg_ft_log(px_dbg_ft_name, (uint16_t)__LINE__); \
} \
while(0)

Macro to log a name and file line number.

Definition at line 123 of file px_dbg_ft.h.

◆ PX_DBG_FT_LOG_LINE

#define PX_DBG_FT_LOG_LINE (   line)
Value:
do \
{ \
_px_dbg_ft_log(px_dbg_ft_name, line); \
} \
while(0)

Macro to log a name and a specified file line number.

Definition at line 131 of file px_dbg_ft.h.

◆ PX_DBG_FT_LOG_PARAM

#define PX_DBG_FT_LOG_PARAM (   param)
Value:
do \
{ \
_px_dbg_ft_log_param(px_dbg_ft_name, (uint16_t)__LINE__, param); \
} \
while(0)

Macro to log a name, file line number and parameter.

Definition at line 139 of file px_dbg_ft.h.

◆ PX_DBG_FT_LOG_LINE_PARAM

#define PX_DBG_FT_LOG_LINE_PARAM (   line,
  param 
)
Value:
do \
{ \
_px_dbg_ft_log_param(px_dbg_ft_name, line, param); \
} \
while(0)

Macro to log a name, specified file line number and parameter.

Definition at line 147 of file px_dbg_ft.h.

◆ PX_DBG_FT [2/2]

#define PX_DBG_FT   0

Disable (0) or Enable (1) debug flow trace.

Definition at line 36 of file px_dbg_ft_cfg_template.h.

◆ PX_DBG_FT_CFG_BUF_SIZE

#define PX_DBG_FT_CFG_BUF_SIZE   16

Debug output string buffer size.

Definition at line 40 of file px_dbg_ft_cfg_template.h.

Enumeration Type Documentation

◆ px_dbg_ft_name_t

Customized name values (must be sequential starting at 0, e.g. 0, 1, 2, 3, ...)

Definition at line 43 of file px_dbg_ft_cfg_template.h.

Function Documentation

◆ _px_dbg_ft_init()

void _px_dbg_ft_init ( void  )

Initialise debug flow trace module.

◆ _px_dbg_ft_log()

void _px_dbg_ft_log ( const px_dbg_ft_name_t  name,
uint16_t  line 
)

Internal function to log a name and file line number.

Parameters
nameCustom name value as defined in 'px_dbg_ft_cfg.h'
lineFile line number

Definition at line 68 of file px_dbg_ft.c.

◆ _px_dbg_ft_log_param()

void _px_dbg_ft_log_param ( const px_dbg_ft_name_t  name,
uint16_t  line,
uint8_t  param 
)

Internal function to log a name, file line number and parameter.

Parameters
nameCustom name value as defined in 'px_dbg_ft_cfg.h'
lineFile line number
paramParameter

Definition at line 80 of file px_dbg_ft.c.

◆ px_dbg_ft_report()

void px_dbg_ft_report ( void  )

Report flow trace logged in buffer.

Definition at line 92 of file px_dbg_ft.c.

Variable Documentation

◆ px_dbg_ft_buf_index

uint8_t px_dbg_ft_buf_index
extern

Index of next empty position; Placed in .noinit section so that it is not set to zero by C initialization code before it can be inspected.

◆ px_dbg_ft_buf

uint32_t px_dbg_ft_buf[PX_DBG_FT_CFG_BUF_SIZE]
extern

Buffer for log output; Placed in .noinit section so that it is not set to zero by C initialization code before it can be inspected.