Download Firmware/Test Bench Parser/debug.h from MCP-1st-Birthday/RAMIE-RAD_AI_Messing_In_Earthworks: direct link, hf CLI and curl.
- Browser
- Download file 5.46 kB
-
https://huggingface.co/spaces/MCP-1st-Birthday/RAMIE-RAD_AI_Messing_In_Earthworks/resolve/refs%2Fpr%2F4/Firmware/Test%20Bench%20Parser/debug.h
- Command line
-
hf download 'hf://spaces/MCP-1st-Birthday/RAMIE-RAD_AI_Messing_In_Earthworks@refs/pr/4/Firmware/Test Bench Parser/debug.h'
-
curl -L -o debug.h https://huggingface.co/spaces/MCP-1st-Birthday/RAMIE-RAD_AI_Messing_In_Earthworks/resolve/refs%2Fpr%2F4/Firmware/Test%20Bench%20Parser/debug.h
5.46 kB
| /********************************************************************************** | |
| ** ENVIROMENT VARIABILE | |
| **********************************************************************************/ | |
| //#define ENABLE_DEBUG | |
| /********************************************************************************** | |
| ** GLOBAL INCLUDE | |
| **********************************************************************************/ | |
| /********************************************************************************** | |
| ** DEFINE | |
| **********************************************************************************/ | |
| /********************************************************************************** | |
| ** MACRO | |
| **********************************************************************************/ | |
| ///---------------------------------------------------------------- | |
| /// GLOBAL VARIABLES | |
| ///---------------------------------------------------------------- | |
| //Variable prototypes for debug | |
| extern FILE *_debug_file; \ | |
| extern int _debug_indent_level, _debug_show_level | |
| //Global variables for debug | |
| FILE *_debug_file = NULL; \ | |
| int _debug_indent_level = 0, _debug_show_level = 0 | |
| //Change the show level | |
| _debug_show_level = (level) | |
| ///---------------------------------------------------------------- | |
| /// DEBUG FILE MACROS | |
| ///---------------------------------------------------------------- | |
| //Open file and start debugging | |
| _debug_file = fopen( "debug.log", "w+"), _debug_indent_level = 0, _debug_show_level = user__debug_show_level , fprintf(_debug_file, "Start Debug!\n") | |
| //Stop debugging and close file | |
| ((_debug_file != NULL)?fprintf(_debug_file, "\nDebug has Ended!\n"), fflush(_debug_file), fclose(_debug_file), _debug_file = NULL:(0)) | |
| ///---------------------------------------------------------------- | |
| /// DEBUG PRINT MACROS | |
| ///---------------------------------------------------------------- | |
| //Print a given number of tab characters | |
| (((_debug_file != NULL) && (_debug_indent_level >= _debug_show_level))?(fprintf(_debug_file,"%.*s", n, "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t")):(0)); | |
| //Print a number of tab equal to indent level than print user defined string | |
| (((_debug_file != NULL) && (_debug_indent_level >= _debug_show_level))?(fprintf(_debug_file,"%.*s", _debug_indent_level, "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t"), fprintf(_debug_file, __VA_ARGS__ )):(0)) | |
| //print user defined string | |
| (((_debug_file != NULL) && (_debug_indent_level >= _debug_show_level))?(fprintf(_debug_file, __VA_ARGS__ )):(0)) | |
| ///---------------------------------------------------------------- | |
| /// FUNCTION TRACE MACROS | |
| ///---------------------------------------------------------------- | |
| //Enter Function and increase indent level. No argument print version | |
| DPRINT( "-->> \"%s\" |\n", __FUNCTION__), (_debug_indent_level<_DEBUG_MAX_INDENT_LEVEL)?(++_debug_indent_level):(_DEBUG_MAX_INDENT_LEVEL) | |
| //Return from function and decrease indent level. No argument version | |
| (_debug_indent_level>0)?(--_debug_indent_level):(0), DPRINT( "<<-- \"%s\" |\n", __FUNCTION__) | |
| //Enter Function and increase indent level. No argument print version | |
| DPRINT( "-->> \"%s\" | ", __FUNCTION__), DPRINT_NOTAB( __VA_ARGS__ ), (_debug_indent_level<_DEBUG_MAX_INDENT_LEVEL)?(++_debug_indent_level):(_DEBUG_MAX_INDENT_LEVEL) | |
| //Return from function and decrease indent level. No argument version | |
| (_debug_indent_level>0)?(--_debug_indent_level):(0), DPRINT( "<<-- \"%s\" | ", __FUNCTION__), DPRINT_NOTAB( __VA_ARGS__ ) | |
| /********************************************************************************** | |
| ** TYPEDEF | |
| **********************************************************************************/ | |
| /********************************************************************************** | |
| ** PROTOTYPE: STRUCTURE | |
| **********************************************************************************/ | |
| /********************************************************************************** | |
| ** PROTOTYPE: GLOBAL VARIABILE | |
| **********************************************************************************/ | |
| //Global variables prototype | |
| DEBUG_VARS_PROTOTYPES(); | |
| /********************************************************************************** | |
| ** PROTOTYPE: FUNCTION | |
| **********************************************************************************/ | |