1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
// 
// 
// 

#include "DebugIface.h"

/**
 * \brief   Init Debug class. Require a verbosity level and a pointer to HW
 * 
 * This HW pointer is used to access to the PrintLineDebugConsole function
 * 
 * Every message with a priority equal or higher of verbose_level is print
 * 
 * \param _vs       Verbosity level
 * \param _hwi      Pointer to hardware class
 */
void DebugIfaceClass::Init(verbose_level _vs, HW* _hwi)
{
	hwi = _hwi;
	vsl = _vs;
}

/**
 * \brief   Change verbosity level
 * 
 * \param _vs       Verbosity class
 */
void DebugIfaceClass::SetVerboseLevel(verbose_level _vs)<--- The function 'SetVerboseLevel' is never used.
{
	vsl = _vs;
}

/**
 * \brief   Print a message on the debug console
 * 
 * \param source        DBG_CODE for code print, DBG_KERNEL for kernel print
 * \param vl            Verbosity level
 * \param s             String to be print
 */
void DebugIfaceClass::DbgPrint(dbg_source source, verbose_level vl, String s)
{
	String msg;
	if (vl <= vsl)
	{
		String src = (source == DBG_CODE ? "CODE" : "KERNEL");
		msg = "[" + src + "] - " + s;
		hwi->PrintLineDebugConsole(msg);
	}
}



//                  #     # ### 
//                  ##    #  #  
//                  # #   #  #  
//                  #  #  #  #  
//                  #   # #  #  
//                  #    ##  #  
//                  #     # ### 
//
// Nuclear Instruments 2020 - All rights reserved
// Any commercial use of this code is forbidden
// Contact info@nuclearinstruments.eu