Debug API¶
-
group
Debug
Defines
-
BASENAME
(_file) ((strrchr(_file, '/') ? : (strrchr(_file, '\\') ? : _file))+1)¶
-
csp_assert
(exp) do { \ if (!(exp)) { \ char *assertion = #exp; \ const char *file = BASENAME(__FILE__); \ int line = __LINE__; \ printf("\E[1;31m[%02"PRIu8"] Assertion \'%s\' failed in %s:%d\E[0m\r\n", \ csp_get_address(), assertion, file, line); \ if (csp_assert_fail_action) \ csp_assert_fail_action(assertion, file, line); \ } \ } while (0)¶
-
CONSTSTR
(data) data¶
-
csp_debug
(...) do {} while (0)¶
-
csp_log_error
(...) do {} while (0)¶
-
csp_log_warn
(...) do {} while (0)¶
-
csp_log_info
(...) do {} while (0)¶
-
csp_log_buffer
(...) do {} while (0)¶
-
csp_log_packet
(...) do {} while (0)¶
-
csp_log_protocol
(...) do {} while (0)¶
-
csp_log_lock
(...) do {} while (0)¶
Enums
Functions
-
void
csp_assert_fail_action
(char *assertion, const char *file, int line)¶
-
void
do_csp_debug
(csp_debug_level_t level, const char *format, ...)¶ This function should not be used directly, use csp_log_<level>() macro instead.
- Parameters
level
:format
:
-
void
csp_debug_toggle_level
(csp_debug_level_t level)¶ Toggle debug level on/off.
- Parameters
level
: Level to toggle
-
void
csp_debug_set_level
(csp_debug_level_t level, bool value)¶ Set debug level.
- Parameters
level
: Level to setvalue
: New level value
-
int
csp_debug_get_level
(csp_debug_level_t level)¶ Get current debug level value.
- Return
- Level value
- Parameters
level
: Level value to get
Variables
-
unsigned char
csp_debug_level_enabled
[]¶
-