| 1 | /*******************************************************************************
|
|---|
| 2 | MODULE : trace.h
|
|---|
| 3 |
|
|---|
| 4 | 19xxxxxx AB Initial
|
|---|
| 5 | *******************************************************************************/
|
|---|
| 6 |
|
|---|
| 7 | // --- Includes ---------------------------------------------------------------
|
|---|
| 8 |
|
|---|
| 9 | // --- Pin Definitions --------------------------------------------------------
|
|---|
| 10 |
|
|---|
| 11 | // --- Defines ----------------------------------------------------------------
|
|---|
| 12 | //#define NO_TRACE // uncomment this line to disable ALL tracing and save ROM space
|
|---|
| 13 | #ifndef NO_TRACE
|
|---|
| 14 | // module specific logging level (0...3)
|
|---|
| 15 | #define MAI_LOGGING 2
|
|---|
| 16 | #define TRA_LOGGING 1
|
|---|
| 17 | #define COMMAND_LOGGING 1
|
|---|
| 18 | #define NVM_LOGGING 1
|
|---|
| 19 | #define COM_LOGGING 1 // 3 to much delay to proper decode telegram
|
|---|
| 20 | #define CRC_LOGGING 2
|
|---|
| 21 | #define MAS_LOGGING 1
|
|---|
| 22 | #define SLV_LOGGING 2
|
|---|
| 23 | #define IIC_LOGGING 1
|
|---|
| 24 | #define HW_LOGGING 2
|
|---|
| 25 | #define ADC_LOGGING 1
|
|---|
| 26 | #define REL_LOGGING 1
|
|---|
| 27 | #define TIM_LOGGING 1
|
|---|
| 28 | #define INP_LOGGING 3
|
|---|
| 29 | #define LED_LOGGING 3
|
|---|
| 30 | #define EVE_LOGGING 1
|
|---|
| 31 | #else
|
|---|
| 32 | // all values should be 0 here (global disable)
|
|---|
| 33 | #define MAI_LOGGING 1
|
|---|
| 34 | #define TRA_LOGGING 0
|
|---|
| 35 | #define COMMAND_LOGGING 0
|
|---|
| 36 | #define NVM_LOGGING 0
|
|---|
| 37 | #define COM_LOGGING 0
|
|---|
| 38 | #define IIC_LOGGING 0
|
|---|
| 39 | #define CRC_LOGGING 0
|
|---|
| 40 | #define MAS_LOGGING 0
|
|---|
| 41 | #define SLV_LOGGING 0
|
|---|
| 42 | #define HW_LOGGING 0
|
|---|
| 43 | #define ADC_LOGGING 0
|
|---|
| 44 | #define REL_LOGGING 0
|
|---|
| 45 | #define TIM_LOGGING 0
|
|---|
| 46 | #define INP_LOGGING 0
|
|---|
| 47 | #define LED_LOGGING 0
|
|---|
| 48 | #define EVE_LOGGING 0
|
|---|
| 49 | #endif // NO_TRACE
|
|---|
| 50 |
|
|---|
| 51 | #ifndef LOGGING_TOKEN
|
|---|
| 52 | // for using TRACE macros in modules define LOGGING_TOKEN
|
|---|
| 53 | // this are the tokens used in the defines above which select logging intensity
|
|---|
| 54 | // f.i. #define LOGGING_TOKEN MAI_LOGGING
|
|---|
| 55 | // #include "trace.h"
|
|---|
| 56 | #error "LOGGING_TOKEN must be defined before including trace.h"
|
|---|
| 57 | #endif
|
|---|
| 58 |
|
|---|
| 59 | #ifdef LOGGING_TOKEN
|
|---|
| 60 | #define TRACE( ... ) trace(sprintf(szTraceBuf, __VA_ARGS__ ))
|
|---|
| 61 | #define TRACE_L2( ... ) if(LOGGING_TOKEN>1) trace(sprintf(szTraceBuf, __VA_ARGS__ ))
|
|---|
| 62 | #define TRACE_L3( ... ) if(LOGGING_TOKEN>2) trace(sprintf(szTraceBuf, __VA_ARGS__ ))
|
|---|
| 63 | #define TRACE_NOLF( ... ) trace_NoLF(sprintf(szTraceBuf, __VA_ARGS__ ))
|
|---|
| 64 | #else
|
|---|
| 65 | #define TRACE( ... )
|
|---|
| 66 | #define TRACE_L2( ... )
|
|---|
| 67 | #define TRACE_L3( ... )
|
|---|
| 68 | #define TRACE_NOLF( ... )
|
|---|
| 69 | #endif
|
|---|
| 70 |
|
|---|
| 71 | //#undef LOGGING_TOKEN
|
|---|
| 72 | //#define LOGGING_TOKEN 3 // in case it was forgotten in table above set to max
|
|---|
| 73 |
|
|---|
| 74 | // --- Typedefs ---------------------------------------------------------------
|
|---|
| 75 |
|
|---|
| 76 | // --- PUBLIC Variables -------------------------------------------------------
|
|---|
| 77 |
|
|---|
| 78 | // --- Variables --------------------------------------------------------------
|
|---|
| 79 |
|
|---|
| 80 | // --- Macros -----------------------------------------------------------------
|
|---|
| 81 |
|
|---|
| 82 | //Dummy_for_() { int WARNING; /* to generate compiler warning */ return 1; }
|
|---|