#include <stdio.h>#include "userDef.h"Go to the source code of this file.
Debug, logging, and assertion API.
This file provides data structures and APIs for debug, logging and assertion.
Definition in file debug.h.
Macros | |
| #define | ANSI_RESET "\033[0m" |
| Reset to default color. | |
| #define | ANSI_RED "\033[31m" |
| Red text. | |
| #define | ANSI_GREEN "\033[32m" |
| Green text. | |
| #define | ANSI_YELLOW "\033[33m" |
| Yellow text. | |
| #define | ANSI_BLUE "\033[34m" |
| Blue text. | |
| #define | ANSI_MAGENTA "\033[35m" |
| Magenta text. | |
| #define | ANSI_CYAN "\033[36m" |
| Cyan text. | |
| #define | ANSI_BOLD "\033[1m" |
| Bold text. | |
| #define | ANSI_UNDER "\033[4m" |
| Underlined text. | |
| #define | DBG_MOD_SYS (1 << 0) |
| System / RISC-V core. | |
| #define | DBG_MOD_IRQ (1 << 1) |
| Interrupt controller. | |
| #define | DBG_MOD_FAULT (1 << 2) |
| Hard faults and errors. | |
| #define | DBG_MOD_UART (1 << 3) |
| UART driver. | |
| #define | DBG_MOD_I2C (1 << 4) |
| I2C driver. | |
| #define | DBG_MOD_SPI (1 << 5) |
| SPI driver. | |
| #define | DBG_MOD_SPI_FLASH (1 << 6) |
| SPI Flash driver. | |
| #define | DBG_MOD_RTC (1 << 7) |
| Real-Time Clock driver. | |
| #define | DBG_MOD_CAM (1 << 8) |
| Camera driver. | |
| #define | DBG_MOD_SENSOR (1 << 9) |
| External sensors. | |
| #define | DBG_MOD_MAIN (1 << 10) |
| Main application. | |
| #define | DBG_MOD_ALL |
| Enable all debug modules. | |
| #define | DBG_LVL_ALL 0 |
| Show Info, Warn, and Error. | |
| #define | DBG_LVL_WARN 1 |
| Show Warn and Error only. | |
| #define | DBG_LVL_ERR 2 |
| Show Error only. | |
| #define | DBG_LVL_NONE 3 |
| Silence — no output. | |
| #define | ACTIVE_DEBUG_MOD 0 |
| Default set to No modules enabled. | |
| #define | ACTIVE_MIN_LVL DBG_LVL_NONE |
| Default set to no logs shown. | |
| #define | BSP_ASSERT(cond, msg) |
| Assert a condition. Prints message and halts on failure. | |
| #define | LOG_INFO(mod, fmt, ...) |
| Log an informational message (green). | |
| #define | LOG_WARN(mod, fmt, ...) |
| Log a warning message (yellow). | |
| #define | LOG_ERR(mod, fmt, ...) |
| Log an error message (red). | |
Functions | |
| void | bsp_putChar (char c) |
|
extern |