STM32F769IDiscovery  1.00
uDANTE Audio Networking with STM32F7 DISCO board
GUI_Debug.h
Go to the documentation of this file.
1 /*********************************************************************
2 * SEGGER Microcontroller GmbH & Co. KG *
3 * Solutions for real time microcontroller applications *
4 **********************************************************************
5 * *
6 * (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
7 * *
8 * Internet: www.segger.com Support: support@segger.com *
9 * *
10 **********************************************************************
11 
12 ** emWin V5.28 - Graphical user interface for embedded applications **
13 All Intellectual Property rights in the Software belongs to SEGGER.
14 emWin is protected by international copyright laws. Knowledge of the
15 source code may not be used to write a similar product. This file may
16 only be used in accordance with the following terms:
17 
18 The software has been licensed to STMicroelectronics International
19 N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
20 les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
21 purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
22 troller products commercialized by Licensee only, sublicensed and dis_
23 tributed under the terms and conditions of the End User License Agree_
24 ment supplied by STMicroelectronics International N.V.
25 Full source code is available at: www.segger.com
26 
27 We appreciate your understanding and fairness.
28 ----------------------------------------------------------------------
29 File : GUI_Debug.h
30 Purpose : Debug macros
31 ----------------------------------------------------------------------
32  Debug macros for logging
33 
34  In the GUI Simulation, all output is transferred into the log window.
35 */
36 
37 #ifndef GUI_DEBUG_H
38 #define GUI_DEBUG_H
39 
40 #include <stddef.h>
41 
42 #include "GUI.h"
43 
44 #define GUI_DEBUG_LEVEL_NOCHECK 0 /* No run time checks are performed */
45 #define GUI_DEBUG_LEVEL_CHECK_PARA 1 /* Parameter checks are performed to avoid crashes */
46 #define GUI_DEBUG_LEVEL_CHECK_ALL 2 /* Parameter checks and consistency checks are performed */
47 #define GUI_DEBUG_LEVEL_LOG_ERRORS 3 /* Errors are recorded */
48 #define GUI_DEBUG_LEVEL_LOG_WARNINGS 4 /* Errors & Warnings are recorded */
49 #define GUI_DEBUG_LEVEL_LOG_ALL 5 /* Errors, Warnings and Messages are recorded. */
50 
51 #ifndef GUI_DEBUG_LEVEL
52  #ifdef WIN32
53  #define GUI_DEBUG_LEVEL GUI_DEBUG_LEVEL_LOG_WARNINGS /* Simulation should log all warnings */
54  #else
55  #define GUI_DEBUG_LEVEL GUI_DEBUG_LEVEL_CHECK_PARA /* For most targets, min. size is important */
56  #endif
57 #endif
58 
59 #define GUI_LOCK_H(hMem) GUI_ALLOC_LockH(hMem)
60 #define GUI_UNLOCK_H(pMem) GUI_ALLOC_UnlockH((void **)&pMem)
61 
62 /*******************************************************************
63 *
64 * Commandline
65 *
66 ********************************************************************
67 */
68 
69 #ifdef WIN32
70  #define GUI_DEBUG_GETCMDLINE() SIM_GetCmdLine()
71 #else
72  #define GUI_DEBUG_GETCMDLINE() 0
73 #endif
74 
75 /*******************************************************************
76 *
77 * Error macros
78 *
79 ********************************************************************
80 */
81 
82 /* Make sure the macros are actually defined */
83 
84 #if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_LOG_ERRORS
85  #define GUI_DEBUG_ERROROUT(s) GUI_ErrorOut(s)
86  #define GUI_DEBUG_ERROROUT1(s,p0) GUI_ErrorOut1(s,p0)
87  #define GUI_DEBUG_ERROROUT2(s,p0,p1) GUI_ErrorOut2(s,p0,p1)
88  #define GUI_DEBUG_ERROROUT3(s,p0,p1,p2) GUI_ErrorOut3(s,p0,p1,p2)
89  #define GUI_DEBUG_ERROROUT4(s,p0,p1,p2,p3) GUI_ErrorOut4(s,p0,p1,p2,p3)
90  #define GUI_DEBUG_ERROROUT_IF(exp,s) { if (exp) GUI_DEBUG_ERROROUT(s); }
91  #define GUI_DEBUG_ERROROUT1_IF(exp,s,p0) { if (exp) GUI_DEBUG_ERROROUT1(s,p0); }
92  #define GUI_DEBUG_ERROROUT2_IF(exp,s,p0,p1) { if (exp) GUI_DEBUG_ERROROUT2(s,p0,p1); }
93  #define GUI_DEBUG_ERROROUT3_IF(exp,s,p0,p1,p2) { if (exp) GUI_DEBUG_ERROROUT3(s,p0,p1,p2); }
94  #define GUI_DEBUG_ERROROUT4_IF(exp,s,p0,p1,p2,p3) { if (exp) GUI_DEBUG_ERROROUT4(s,p0,p1,p2,p3); }
95 #else
96  #define GUI_DEBUG_ERROROUT(s)
97  #define GUI_DEBUG_ERROROUT1(s,p0)
98  #define GUI_DEBUG_ERROROUT2(s,p0,p1)
99  #define GUI_DEBUG_ERROROUT3(s,p0,p1,p2)
100  #define GUI_DEBUG_ERROROUT4(s,p0,p1,p2,p3)
101  #define GUI_DEBUG_ERROROUT_IF(exp,s)
102  #define GUI_DEBUG_ERROROUT1_IF(exp,s,p0)
103  #define GUI_DEBUG_ERROROUT2_IF(exp,s,p0,p1)
104  #define GUI_DEBUG_ERROROUT3_IF(exp,s,p0,p1,p2)
105  #define GUI_DEBUG_ERROROUT4_IF(exp,s,p0,p1,p2,p3)
106 #endif
107 
108 /*******************************************************************
109 *
110 * Warning macros
111 *
112 ********************************************************************
113 */
114 
115 /* Make sure the macros are actually defined */
116 
117 #if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_LOG_WARNINGS
118  #define GUI_DEBUG_WARN(s) GUI_Warn(s)
119  #define GUI_DEBUG_WARN1(s,p0) GUI_Warn1(s,p0)
120  #define GUI_DEBUG_WARN2(s,p0,p1) GUI_Warn2(s,p0,p1)
121  #define GUI_DEBUG_WARN3(s,p0,p1,p2) GUI_Warn3(s,p0,p1,p2)
122  #define GUI_DEBUG_WARN4(s,p0,p1,p2,p3) GUI_Warn4(s,p0,p1,p2,p3)
123  #define GUI_DEBUG_WARN_IF(exp,s) { if (exp) GUI_DEBUG_WARN(s); }
124  #define GUI_DEBUG_WARN1_IF(exp,s,p0) { if (exp) GUI_DEBUG_WARN1(s,p0); }
125  #define GUI_DEBUG_WARN2_IF(exp,s,p0,p1) { if (exp) GUI_DEBUG_WARN2(s,p0,p1); }
126  #define GUI_DEBUG_WARN3_IF(exp,s,p0,p1,p2) { if (exp) GUI_DEBUG_WARN3(s,p0,p1,p2); }
127  #define GUI_DEBUG_WARN4_IF(exp,s,p0,p1,p2,p3) { if (exp) GUI_DEBUG_WARN4(s,p0,p1,p2,p3); }
128 #else
129  #define GUI_DEBUG_WARN(s)
130  #define GUI_DEBUG_WARN1(s,p0)
131  #define GUI_DEBUG_WARN2(s,p0,p1)
132  #define GUI_DEBUG_WARN3(s,p0,p1,p2)
133  #define GUI_DEBUG_WARN4(s,p0,p1,p2,p3)
134  #define GUI_DEBUG_WARN_IF(exp,s)
135  #define GUI_DEBUG_WARN1_IF(exp,s,p0)
136  #define GUI_DEBUG_WARN2_IF(exp,s,p0,p1)
137  #define GUI_DEBUG_WARN3_IF(exp,s,p0,p1,p2)
138  #define GUI_DEBUG_WARN4_IF(exp,s,p0,p1,p2,p3)
139 #endif
140 
141 /*******************************************************************
142 *
143 * Logging macros
144 *
145 ********************************************************************
146 */
147 /* Make sure the macros are actually defined */
148 
149 #if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_LOG_ALL
150  #define GUI_DEBUG_LOG(s) GUI_Log(s)
151  #define GUI_DEBUG_LOG1(s,p0) GUI_Log1(s,p0)
152  #define GUI_DEBUG_LOG2(s,p0,p1) GUI_Log2(s,p0,p1)
153  #define GUI_DEBUG_LOG3(s,p0,p1,p2) GUI_Log3(s,p0,p1,p2)
154  #define GUI_DEBUG_LOG4(s,p0,p1,p2,p3) GUI_Log4(s,p0,p1,p2,p3)
155  #define GUI_DEBUG_LOG_IF(exp,s) { if (exp) GUI_DEBUG_LOG(s); }
156  #define GUI_DEBUG_LOG1_IF(exp,s,p0) { if (exp) GUI_DEBUG_LOG1(s,p0); }
157  #define GUI_DEBUG_LOG2_IF(exp,s,p0,p1) { if (exp) GUI_DEBUG_LOG2(s,p0,p1); }
158  #define GUI_DEBUG_LOG3_IF(exp,s,p0,p1,p2) { if (exp) GUI_DEBUG_LOG3(s,p0,p1,p2); }
159  #define GUI_DEBUG_LOG4_IF(exp,s,p0,p1,p2,p3) { if (exp) GUI_DEBUG_LOG4(s,p0,p1,p2,p3); }
160 #else
161  #define GUI_DEBUG_LOG(s)
162  #define GUI_DEBUG_LOG1(s,p0)
163  #define GUI_DEBUG_LOG2(s,p0,p1)
164  #define GUI_DEBUG_LOG3(s,p0,p1,p2)
165  #define GUI_DEBUG_LOG4(s,p0,p1,p2,p3)
166  #define GUI_DEBUG_LOG_IF(exp,s)
167  #define GUI_DEBUG_LOG1_IF(exp,s,p0)
168  #define GUI_DEBUG_LOG2_IF(exp,s,p0,p1)
169  #define GUI_DEBUG_LOG3_IF(exp,s,p0,p1,p2)
170  #define GUI_DEBUG_LOG4_IF(exp,s,p0,p1,p2,p3)
171 #endif
172 
173 /*******************************************************************
174 *
175 * Asserts
176 *
177 ********************************************************************
178 */
179 #if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_LOG_ERRORS
180  #define GUI_DEBUG_ASSERT(exp) { if (!exp) GUI_DEBUG_ERROROUT(#exp); }
181 #else
182  #define GUI_DEBUG_ASSERT(exp)
183 #endif
184 
185 #endif /* LCD_H */
186 
187 
188 
189 
190 /*************************** End of file ****************************/