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