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
64
65
66
67
68
// DebugIface.h

#ifndef _DEBUGIFACE_h
#define _DEBUGIFACE_h

#if defined(ARDUINO) && ARDUINO >= 100
	#include "arduino.h"
#else
	#include "WProgram.h"
#endif

#include "hw.h"

/**
 * Level of priority of debug print
 */
typedef enum {	DBG_NONE=0, 
				DBG_CRITICAL = 1, 
				DBG_ERROR = 2, 
				DBG_WARNING = 3, 
				DBG_INFO = 4, 
				DBG_VALUE = 5, 
				DBG_ALL = 6} verbose_level;

typedef enum {DBG_CODE, DBG_KERNEL} dbg_source;

/**
 * \brief   Debug class: this class print debug message
 * 
 * The class permit to specify for each message
 *		- priority
 *		- source	CODE/KERNEL
 * 
 * The class allows to set a minimum print level in order
 * to reduce messages
 */
class DebugIfaceClass
{
private:
	HW* hwi;
	verbose_level vsl;
 protected:


 public:
	void Init(verbose_level _vs, HW *_hwi);
	void SetVerboseLevel(verbose_level _vs);
	void DbgPrint(dbg_source source, verbose_level vl, String s);

};

extern DebugIfaceClass DebugIface;

#endif



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