Foenix A2650 OS/f Library
 
Loading...
Searching...
No Matches
debug.h
Go to the documentation of this file.
1
2
3/*
4 * debug.h
5 *
6 * Created on: July 6, 2024
7 * Author: micahbly
8 */
9
10// This is the debug stuff extracted from general.c.
11// adapted from F256e version to A2560K beginning Dec 26, 2024
12
13#ifndef DEBUG_H_
14#define DEBUG_H_
15
16
17/* about this class
18 *
19 *
20 *
21 *** things this class needs to be able to do
22 * print debug statements to file or screen or RS232
23 * (all functions in this class are excluded from compiling unless one or more debug LOG_LEVEL_1, etc macros are defined)
24 *
25 *** things objects of this class have
26 *
27 *
28 */
29
30
31/*****************************************************************************/
32/* Includes */
33/*****************************************************************************/
34
35// project includes
36//#include "text.h"
37
38// C includes
39#include <stdbool.h>
40#include <stdint.h>
41
42// F256 includes
43
44/*****************************************************************************/
45/* Macro Definitions */
46/*****************************************************************************/
47
48
49#ifdef LOG_LEVEL_1
50 #define LOG_ERR(x) General_LogError x
51#else
52 #define LOG_ERR(x)
53#endif
54#ifdef LOG_LEVEL_2
55 #define LOG_WARN(x) General_LogWarning x
56#else
57 #define LOG_WARN(x)
58#endif
59#ifdef LOG_LEVEL_3
60 #define LOG_INFO(x) General_LogInfo x
61#else
62 #define LOG_INFO(x)
63#endif
64#ifdef LOG_LEVEL_4
65 #define DEBUG_OUT(x) General_DebugOut x
66#else
67 #define DEBUG_OUT(x)
68#endif
69#ifdef LOG_LEVEL_5
70 #define LOG_ALLOC(x) General_LogAlloc x
71 #define TRACK_ALLOC(x) General_TrackAlloc x
72#else
73 #define LOG_ALLOC(x)
74 #define TRACK_ALLOC(x)
75#endif
76
77
78/*****************************************************************************/
79/* Enumerations */
80/*****************************************************************************/
81
82#define LogError 0
83#define LogWarning 1
84#define LogInfo 2
85#define LogDebug 3
86#define LogAlloc 4
87
88
89/*****************************************************************************/
90/* Structs */
91/*****************************************************************************/
92
93
94/*****************************************************************************/
95/* Global Variables */
96/*****************************************************************************/
97
98
99/*****************************************************************************/
100/* Public Function Prototypes */
101/*****************************************************************************/
102
103
104
105// **** LOGGING AND DEBUG UTILITIES *****
106
107
108
109// // Print out a section of memory in a hex viewer style
110// // display length is hard-coded to one screen at 80x59 (MEM_DUMP_BYTES_PER_ROW * MAX_TEXT_VIEW_ROWS_PER_PAGE)
111// void General_ViewHexDump(uint8_t* the_buffer);
112
113
114
115// ********* logging functionality. requires global_log_file to have been opened.
116void General_LogError(const char* format, ...);
117void General_LogWarning(const char* format, ...);
118void General_LogInfo(const char* format, ...);
119void General_DebugOut(const char* format, ...);
120void General_LogAlloc(const char* format, ...);
121bool General_LogInitialize(void);
122void General_LogCleanUp(void);
123void General_TrackAlloc(int32_t the_allocation);
124
125
126
127
128
129#endif /* DEBUG_H_ */