DSMCC  17.9.0
 All Data Structures Files Functions Typedefs
dm_debug.h
Go to the documentation of this file.
1 /*******************************************************************************
2  * Copyright © 2014 The DTVKit Open Software Foundation Ltd (www.dtvkit.org)
3  * Copyright © 2004 Ocean Blue Software Ltd
4  *
5  * This file is part of a DTVKit Software Component
6  * You are permitted to copy, modify or distribute this file subject to the terms
7  * of the DTVKit 1.0 Licence which can be found in licence.txt or at www.dtvkit.org
8  *
9  * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
10  * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES
11  * OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
12  *
13  * If you or your organisation is not a member of DTVKit then you have access
14  * to this source code outside of the terms of the licence agreement
15  * and you are expected to delete this and any associated files immediately.
16  * Further information on DTVKit, membership and terms can be found at www.dtvkit.org
17  *******************************************************************************/
24 #ifndef _DM_DEBUG_H
25 #define _DM_DEBUG_H
26 
27 
28 #ifndef NDEBUG
29 
30  #include <stdio.h>
31  #include <assert.h>
32  #include "stb_debug.h"
33  #include "dsm_debug.h"
34 
35  #ifdef DEBUG_ASSERT
36  #define ASSERT(condition) if (!(condition)) STB_SPDebugAssertFail(__FILE__, __LINE__, # condition);
37  #else
38  #include <assert.h>
39  #define ASSERT(condition) assert(condition);
40  #endif
41 
42  #if DSM_DP_LEVEL >= 1
43  #define DBG_ErrorPrintf (F_Printf)STB_SPDebugNoCnWrite
44  #else
45  #define DBG_ErrorPrintf (F_Printf)NULL
46  #endif
47  #if DSM_DP_LEVEL >= 2
48  #define DBG_WarnPrintf (F_Printf)STB_SPDebugNoCnWrite
49  #else
50  #define DBG_WarnPrintf (F_Printf)NULL
51  #endif
52  #if DSM_DP_LEVEL >= 3
53  #define DBG_DebugPrintf (F_Printf)STB_SPDebugNoCnWrite
54  #else
55  #define DBG_DebugPrintf (F_Printf)NULL
56  #endif
57  #if DSM_DP_LEVEL >= 4
58  #define DBG_InfoPrintf (F_Printf)STB_SPDebugNoCnWrite
59  #else
60  #define DBG_InfoPrintf (F_Printf)NULL
61  #endif
62 
63  #define ERRPRINT(x, ...) STB_SPDebugWrite( "%s:%d " x, __FUNCTION__, __LINE__, ##__VA_ARGS__);
64  #define DBGPRINT(t, x, ...) if (DebugInstanceGetMask(dsmctrl) & t) \
65  STB_SPDebugWrite( "%s:%d " x, __FUNCTION__, __LINE__, ##__VA_ARGS__);
66 
67  U32BIT DebugInstanceGetMask(H_DsmControl dsmctrl);
68 
69 #else
70 
71  #define ASSERT(condition)
72  #define ERRPRINT(...)
73  #define DBGPRINT(...)
74 
75  #define DBG_ErrorPrintf NULL
76  #define DBG_DebugPrintf NULL
77 
78 #endif
79 
80  #define FUNCTION_START(x)
81  #define FUNCTION_FINISH(x)
82 
83 
84 #endif /*_DM_DEBUG_H*/
Interface to platform debug functions.
DSM-CC API functions to control DSM-CC instance.