kerneltest/e32test/usb/t_usb_device/include/general.h
changeset 247 d8d70de2bd36
parent 0 a41df078684a
child 253 d37db4dcc88d
equal deleted inserted replaced
201:43365a9b78a3 247:d8d70de2bd36
     1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 1997-2010 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     3 // This component and the accompanying materials are made available
     4 // under the terms of the License "Eclipse Public License v1.0"
     4 // under the terms of the License "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
   141 #define HiByte(a) (TUint8)((a)>>8) 	
   141 #define HiByte(a) (TUint8)((a)>>8) 	
   142 #define LoByte(a) (TUint8)((a)&0xFF)
   142 #define LoByte(a) (TUint8)((a)&0xFF)
   143 
   143 
   144 #define TUSB_PRINT(string) \
   144 #define TUSB_PRINT(string) \
   145 		do { \
   145 		do { \
   146 		iConsole->Printf(_L(string)); \
   146 			if (iConsole) \
   147 		iConsole->Printf(_L("\n")); \
   147 			{			\
       
   148 		    iConsole->Printf(_L(string)); \
       
   149 		    iConsole->Printf(_L("\n")); \
       
   150 			} \
   148 		RDebug::Print(_L(string)); \
   151 		RDebug::Print(_L(string)); \
   149 		} while (0)
   152 		} while (0)
   150 
   153 
   151 #define TUSB_PRINT1(string, a) \
   154 #define TUSB_PRINT1(string, a) \
   152 		do { \
   155 		do { \
   153 		iConsole->Printf(_L(string), (a)); \
   156 		if (iConsole) \
   154 		iConsole->Printf(_L("\n")); \
   157 			{			\
       
   158 			iConsole->Printf(_L(string), (a)); \
       
   159 			iConsole->Printf(_L("\n")); \
       
   160 			}	\
   155 		RDebug::Print(_L(string), (a)); \
   161 		RDebug::Print(_L(string), (a)); \
   156 		} while (0)
   162 		} while (0)
   157 
   163 
   158 #define TUSB_PRINT2(string, a, b) \
   164 #define TUSB_PRINT2(string, a, b) \
   159 		do { \
   165 		do { \
   160 		iConsole->Printf(_L(string), (a), (b)); \
   166 			if (iConsole) \
   161 		iConsole->Printf(_L("\n")); \
   167 			{			\
       
   168 			iConsole->Printf(_L(string), (a), (b)); \
       
   169 			iConsole->Printf(_L("\n")); \
       
   170 			}	\
   162 		RDebug::Print(_L(string), (a), (b)); \
   171 		RDebug::Print(_L(string), (a), (b)); \
   163 		} while (0)
   172 		} while (0)
   164 
   173 
   165 #define TUSB_PRINT3(string, a, b, c) \
   174 #define TUSB_PRINT3(string, a, b, c) \
   166 		do { \
   175 		do { \
   167 		iConsole->Printf(_L(string), (a), (b), (c)); \
   176 			if (iConsole) \
   168 		iConsole->Printf(_L("\n")); \
   177 			{			\
       
   178 			iConsole->Printf(_L(string), (a), (b), (c)); \
       
   179 			iConsole->Printf(_L("\n")); \
       
   180 			}	\
   169 		RDebug::Print(_L(string), (a), (b), (c)); \
   181 		RDebug::Print(_L(string), (a), (b), (c)); \
   170 		} while (0)
   182 		} while (0)
   171 
   183 
   172 #define TUSB_PRINT4(string, a, b, c, d) \
   184 #define TUSB_PRINT4(string, a, b, c, d) \
   173 		do { \
   185 		do { \
   174 		iConsole->Printf(_L(string), (a), (b), (c), (d)); \
   186 			if (iConsole) \
   175 		iConsole->Printf(_L("\n")); \
   187 			{			\
       
   188 			iConsole->Printf(_L(string), (a), (b), (c), (d)); \
       
   189 			iConsole->Printf(_L("\n")); \
       
   190 			}	\
   176 		RDebug::Print(_L(string), (a), (b), (c), (d)); \
   191 		RDebug::Print(_L(string), (a), (b), (c), (d)); \
   177 		} while (0)
   192 		} while (0)
   178 
   193 
   179 #define TUSB_PRINT5(string, a, b, c, d, e) \
   194 #define TUSB_PRINT5(string, a, b, c, d, e) \
   180 		do { \
   195 		do { \
   181 		iConsole->Printf(_L(string), (a), (b), (c), (d), (e)); \
   196 			if (iConsole) \
   182 		iConsole->Printf(_L("\n")); \
   197 			{			\
       
   198 			iConsole->Printf(_L(string), (a), (b), (c), (d), (e)); \
       
   199 			iConsole->Printf(_L("\n")); \
       
   200 			}	\
   183 		RDebug::Print(_L(string), (a), (b), (c), (d), (e)); \
   201 		RDebug::Print(_L(string), (a), (b), (c), (d), (e)); \
   184 		} while (0)
   202 		} while (0)
   185 
   203 
   186 #define TUSB_PRINT6(string, a, b, c, d, e, f) \
   204 #define TUSB_PRINT6(string, a, b, c, d, e, f) \
   187 		do { \
   205 		do { \
   188 		iConsole->Printf(_L(string), (a), (b), (c), (d), (e), (f)); \
   206 			if (iConsole) \
   189 		iConsole->Printf(_L("\n")); \
   207 			{			\
       
   208 			iConsole->Printf(_L(string), (a), (b), (c), (d), (e), (f)); \
       
   209 			iConsole->Printf(_L("\n")); \
       
   210 			}	\
   190 		RDebug::Print(_L(string), (a), (b), (c), (d), (e), (f)); \
   211 		RDebug::Print(_L(string), (a), (b), (c), (d), (e), (f)); \
   191 		} while (0)
   212 		} while (0)
   192 
   213 
   193 #define TUSB_VERBOSE_PRINT(string) \
   214 #define TUSB_VERBOSE_PRINT(string) \
   194 		do { \
   215 		do { \
   240 
   261 
   241 #define TUSB_VERBOSE_APRINT(string) \
   262 #define TUSB_VERBOSE_APRINT(string) \
   242 		do { \
   263 		do { \
   243 		if (gVerbose) \
   264 		if (gVerbose) \
   244 			{ \
   265 			{ \
   245 			aConsole->Printf(_L(string)); \
   266 				if (iConsole) \
   246 			aConsole->Printf(_L("\n")); \
   267 				{			\
       
   268 				aConsole->Printf(_L(string)); \
       
   269 				aConsole->Printf(_L("\n")); \
       
   270 				}	\
   247 			RDebug::Print(_L(string)); \
   271 			RDebug::Print(_L(string)); \
   248 			} \
   272 			} \
   249 		} while (0)
   273 		} while (0)
   250 
   274 
   251 #define TUSB_HEAPSIZE(string) \
   275 #define TUSB_HEAPSIZE(string) \