OpenSSD Cosmos+ Platform Firmware  0.0.2
The firmware of Cosmos+ OpenSSD Platform for TOSHIBA nand flash module.
debug.h File Reference
#include "stdint.h"
#include "xil_printf.h"
Include dependency graph for debug.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define PR_RESET   "\e[0m"
 
#define PR_DEBUG   "\e[32;49;1mDEBUG "
 
#define PR_INFO   "\e[34;49;1mINFO "
 
#define PR_WARN   "\e[33;49;1mWARN "
 
#define PR_ERROR   "\e[31;49;1mERROR "
 
#define CODE_POS_FMT   "(%s() at %s:%d):: "
 
#define CODE_POS_ARGS   __func__, __FILE__, __LINE__
 
#define SPLIT_LINE   "-----------------------------------------------------------------------------\n"
 
#define printf   xil_printf
 
#define pr_raw   xil_printf
 
#define pr(fmt, ...)   pr_raw(fmt "\r\n", ##__VA_ARGS__)
 
#define pr_debug(fmt, ...)
 
#define pr_info(fmt, ...)   pr(PR_INFO PR_RESET fmt, ##__VA_ARGS__)
 
#define pr_warn(fmt, ...)   pr(PR_WARN CODE_POS_FMT PR_RESET fmt, CODE_POS_ARGS, ##__VA_ARGS__)
 
#define pr_error(fmt, ...)   pr(PR_ERROR CODE_POS_FMT PR_RESET fmt, CODE_POS_ARGS, ##__VA_ARGS__)
 
#define MEMBER_SIZE(type, mem)   (sizeof((((type *)0)->mem)))
 
#define ASSERT(cond, ...)
 
#define STATIC_ASSERT(cond)   ((int)(sizeof(struct { int : (-!(cond)); })))
 

Macro Definition Documentation

◆ ASSERT

#define ASSERT (   cond,
  ... 
)
Value:
({ \
if (!(cond)) \
{ \
pr_error("assert failed: " __VA_ARGS__); \
while (1) \
; \
} \
})

Definition at line 96 of file debug.h.

◆ CODE_POS_ARGS

#define CODE_POS_ARGS   __func__, __FILE__, __LINE__

Definition at line 68 of file debug.h.

◆ CODE_POS_FMT

#define CODE_POS_FMT   "(%s() at %s:%d):: "

Definition at line 67 of file debug.h.

◆ MEMBER_SIZE

#define MEMBER_SIZE (   type,
  mem 
)    (sizeof((((type *)0)->mem)))

Definition at line 94 of file debug.h.

◆ pr

#define pr (   fmt,
  ... 
)    pr_raw(fmt "\r\n", ##__VA_ARGS__)

Definition at line 79 of file debug.h.

◆ PR_DEBUG

#define PR_DEBUG   "\e[32;49;1mDEBUG "

Definition at line 58 of file debug.h.

◆ pr_debug

#define pr_debug (   fmt,
  ... 
)

Definition at line 84 of file debug.h.

◆ PR_ERROR

#define PR_ERROR   "\e[31;49;1mERROR "

Definition at line 61 of file debug.h.

◆ pr_error

#define pr_error (   fmt,
  ... 
)    pr(PR_ERROR CODE_POS_FMT PR_RESET fmt, CODE_POS_ARGS, ##__VA_ARGS__)

Definition at line 88 of file debug.h.

◆ PR_INFO

#define PR_INFO   "\e[34;49;1mINFO "

Definition at line 59 of file debug.h.

◆ pr_info

#define pr_info (   fmt,
  ... 
)    pr(PR_INFO PR_RESET fmt, ##__VA_ARGS__)

Definition at line 86 of file debug.h.

◆ pr_raw

#define pr_raw   xil_printf

Definition at line 78 of file debug.h.

◆ PR_RESET

#define PR_RESET   "\e[0m"

Definition at line 57 of file debug.h.

◆ PR_WARN

#define PR_WARN   "\e[33;49;1mWARN "

Definition at line 60 of file debug.h.

◆ pr_warn

#define pr_warn (   fmt,
  ... 
)    pr(PR_WARN CODE_POS_FMT PR_RESET fmt, CODE_POS_ARGS, ##__VA_ARGS__)

Definition at line 87 of file debug.h.

◆ printf

#define printf   xil_printf

Definition at line 75 of file debug.h.

◆ SPLIT_LINE

#define SPLIT_LINE   "-----------------------------------------------------------------------------\n"

Definition at line 69 of file debug.h.

◆ STATIC_ASSERT

#define STATIC_ASSERT (   cond)    ((int)(sizeof(struct { int : (-!(cond)); })))

Definition at line 107 of file debug.h.