93 lines
2.5 KiB
C
93 lines
2.5 KiB
C
/**
|
|
****************************************************************************************
|
|
*
|
|
* @file dbg.h
|
|
*
|
|
* @brief Debug function
|
|
*
|
|
* Copyright (C) RivieraWaves 2009-2015
|
|
*
|
|
*
|
|
****************************************************************************************
|
|
*/
|
|
#ifndef DBG_H_
|
|
#define DBG_H_
|
|
|
|
/**
|
|
****************************************************************************************
|
|
* @addtogroup DBG
|
|
* @ingroup CONTROLLER
|
|
* @brief Debug
|
|
*
|
|
* @{
|
|
****************************************************************************************
|
|
*/
|
|
|
|
/*
|
|
* INCLUDE FILES
|
|
****************************************************************************************
|
|
*/
|
|
#include "rwip_config.h" // stack configuration
|
|
|
|
#include "dbg_swdiag.h" // sw profiling definitions
|
|
|
|
#include "dbg_trc.h" // debug tracer definition
|
|
|
|
/*
|
|
* FUNCTION DECLARATION
|
|
****************************************************************************************
|
|
*/
|
|
|
|
#define _DEBUG_ 0
|
|
|
|
#if CMD_TEST
|
|
#define TEST_LOGI(...) DEBUG(__VA_ARGS__)
|
|
#else
|
|
#define TEST_LOGI(...)
|
|
#endif
|
|
|
|
|
|
#if _DEBUG_
|
|
#define LOGI(...) DEBUG(__VA_ARGS__)
|
|
#define DUMP_DATA_PRINTF(data, length) printf_hexdump((uint8_t *)data, length)
|
|
#define LOGI_ERR(...) \
|
|
do { \
|
|
DEBUG("[%s] [%d]: ", __FILE__, __LINE__); \
|
|
DEBUG(__VA_ARGS__); \
|
|
} while (0)
|
|
#else
|
|
#define LOGI(...)
|
|
#define DUMP_DATA_PRINTF(data, length)
|
|
#define LOGI_ERR(...)
|
|
#endif
|
|
|
|
#define _TOSTRING(s) #s
|
|
#define TOSTRING(s) _TOSTRING(s)
|
|
|
|
/**
|
|
****************************************************************************************
|
|
* @brief Initialization of the BT Debug task
|
|
*
|
|
* This function initializes the the DBG task
|
|
*
|
|
* @param[in] init_type Type of initialization (@see enum rwip_init_type)
|
|
****************************************************************************************
|
|
*/
|
|
void dbg_init(uint8_t init_type);
|
|
|
|
/**
|
|
****************************************************************************************
|
|
* @brief Send back to host status of platform reset request.
|
|
*
|
|
* @param status Reset error code
|
|
*
|
|
****************************************************************************************
|
|
*/
|
|
void dbg_platform_reset_complete(uint32_t error);
|
|
|
|
void printf_hexdump(const void *data, int length);
|
|
|
|
///@} DBG
|
|
|
|
#endif // DBG_H_
|